1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00

chore: add devcontainer

This commit is contained in:
divlo 2021-06-12 22:30:02 +00:00
parent d9b53480be
commit 7af4d3c512
10 changed files with 1423 additions and 1317 deletions

7
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/javascript-node/.devcontainer/base.Dockerfile
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
ARG EXTRA_NODE_VERSION=16
RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

View File

@ -0,0 +1,24 @@
{
"name": "divlo",
"dockerComposeFile": "./docker-compose.yml",
"service": "workspace",
"workspaceFolder": "/workspace",
"settings": {
"remote.autoForwardPorts": false
},
"extensions": [
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"divlo.vscode-styled-jsx-syntax",
"divlo.vscode-styled-jsx-languageserver",
"bradlc.vscode-tailwindcss",
"mikestead.dotenv",
"coenraads.bracket-pair-colorizer",
"davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker"
],
"forwardPorts": [3000],
"postAttachCommand": ["npm", "clean-install"],
"remoteUser": "node"
}

View File

@ -0,0 +1,10 @@
version: '3.0'
services:
workspace:
build:
context: './'
dockerfile: './Dockerfile'
volumes:
- '..:/workspace:cached'
command: 'sleep infinity'

View File

@ -1,11 +1,11 @@
.vscode .vscode
.git .git
.next .env
build build
.next
coverage coverage
dist
node_modules node_modules
out tmp
**/workbox-*.js temp
**/sw.js .DS_Store
**/__test__/** .lighthouseci

View File

@ -8,6 +8,7 @@
"bradlc.vscode-tailwindcss", "bradlc.vscode-tailwindcss",
"mikestead.dotenv", "mikestead.dotenv",
"coenraads.bracket-pair-colorizer", "coenraads.bracket-pair-colorizer",
"davidanson.vscode-markdownlint" "davidanson.vscode-markdownlint",
"ms-azuretools.vscode-docker"
] ]
} }

View File

@ -1,11 +1,23 @@
FROM node:16.3.0 FROM node:16.3.0 AS dependencies
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN chown --recursive node:node /usr/src/app COPY ./package*.json ./
COPY --chown=node:node ./package*.json ./ RUN npm clean-install
RUN npm install
COPY --chown=node:node ./ ./
USER node FROM node:16.3.0 AS builder
WORKDIR /usr/src/app
COPY ./ ./
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
RUN npm run build RUN npm run build
CMD ["npm", "run", "start", "--", "--port", "${PORT}"]
FROM node:16.3.0 AS runner
WORKDIR /usr/src/app
ENV NODE_ENV=production
COPY --from=builder /usr/src/app/next.config.js ./next.config.js
COPY --from=builder /usr/src/app/public ./public
COPY --from=builder /usr/src/app/.next ./.next
COPY --from=builder /usr/src/app/i18n.json ./i18n.json
COPY --from=builder /usr/src/app/locales ./locales
COPY --from=builder /usr/src/app/pages ./pages
COPY --from=builder /usr/src/app/node_modules ./node_modules
RUN npx next telemetry disable
CMD ["node_modules/.bin/next", "start", "--port", "${PORT}"]

View File

@ -9,3 +9,4 @@ services:
- '${PORT}:${PORT}' - '${PORT}:${PORT}'
environment: environment:
PORT: ${PORT} PORT: ${PORT}
env_file: './.env'

View File

@ -11,18 +11,6 @@ module.exports = {
'@testing-library/react' '@testing-library/react'
], ],
collectCoverage: true, collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,jsx,ts,tsx}',
'!**/*.d.ts',
'!**/.next/**',
'!**/node_modules/**',
'!**/next.config.js',
'!**/postcss.config.js',
'!**/tailwind.config.js',
'!**/workbox-*.js',
'!**/sw.js',
'!**/jest.config.js'
],
coverageDirectory: './coverage', coverageDirectory: './coverage',
coverageReporters: ['text', 'cobertura'] coverageReporters: ['text', 'cobertura']
} }

2637
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,10 @@
"type": "git", "type": "git",
"url": "https://github.com/Divlo/Divlo" "url": "https://github.com/Divlo/Divlo"
}, },
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"start": "next start", "start": "next start",
@ -42,7 +46,7 @@
"@commitlint/cli": "12.1.4", "@commitlint/cli": "12.1.4",
"@commitlint/config-conventional": "12.1.4", "@commitlint/config-conventional": "12.1.4",
"@lhci/cli": "0.8.0", "@lhci/cli": "0.8.0",
"@testing-library/jest-dom": "5.13.0", "@testing-library/jest-dom": "5.14.1",
"@testing-library/react": "11.2.7", "@testing-library/react": "11.2.7",
"@types/jest": "26.0.23", "@types/jest": "26.0.23",
"@types/node": "15.12.2", "@types/node": "15.12.2",