Added docker to project

This commit is contained in:
Ceferino Patino 2022-12-11 22:07:56 -06:00
commit 604e7f22f6
5 changed files with 110 additions and 0 deletions

9
client/Dockerfile Normal file
View file

@ -0,0 +1,9 @@
# syntax=docker/dockerfile:1
FROM node:16-alpine
WORKDIR /app
COPY ["package.json", "./"]
RUN apk update
RUN npm install
COPY . .
EXPOSE 3000/tcp
CMD npm start

View file

@ -7,6 +7,7 @@
"@emotion/styled": "^11.9.3", "@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4", "@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.1", "@mui/material": "^5.9.1",
"buffer": "^6.0.3",
"dompurify": "^2.3.10", "dompurify": "^2.3.10",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"formik": "^2.2.9", "formik": "^2.2.9",

56
docker-compose.yml Normal file
View file

@ -0,0 +1,56 @@
version: '3.8'
services:
client:
restart: unless-stopped
build:
context: ./client
ports:
- 3000:3000
volumes:
- ./client:/app
- client-node:/app/node_modules
networks:
- qOverflow
env_file: ./client/.env
environment:
WATCHPACK_POLLING: true
depends_on:
- server
server:
restart: unless-stopped
build:
context: ./server
ports:
- 3001:3001
volumes:
- ./server:/app
- server-node:/app/node_modules
networks:
- qOverflow
env_file: ./server/.env
environment:
DB_CONN_STRING: 'mongodb://mongodb:27017'
CHOKIDAR_USEPOLLING: true
depends_on:
- mongodb
mongodb:
restart: unless-stopped
image: mongo:5
ports:
- 27017:27017
volumes:
- data:/data/db
- db-config:/data/configdb
networks:
- qOverflow
logging:
driver: none
volumes:
data:
db-config:
client-node:
server-node:
networks:
qOverflow: {}

36
package-lock.json generated
View file

@ -26,6 +26,7 @@
"@emotion/styled": "^11.9.3", "@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4", "@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.1", "@mui/material": "^5.9.1",
"buffer": "^6.0.3",
"dompurify": "^2.3.10", "dompurify": "^2.3.10",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"formik": "^2.2.9", "formik": "^2.2.9",
@ -48,6 +49,29 @@
"yup": "^0.32.11" "yup": "^0.32.11"
} }
}, },
"client/node_modules/buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
}
},
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz",
@ -24925,6 +24949,7 @@
"@emotion/styled": "^11.9.3", "@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4", "@mui/icons-material": "^5.8.4",
"@mui/material": "^5.9.1", "@mui/material": "^5.9.1",
"buffer": "*",
"dompurify": "^2.3.10", "dompurify": "^2.3.10",
"dotenv": "^16.0.1", "dotenv": "^16.0.1",
"formik": "^2.2.9", "formik": "^2.2.9",
@ -24945,6 +24970,17 @@
"superagent-throttle": "^1.0.1", "superagent-throttle": "^1.0.1",
"universal-cookie": "^4.0.4", "universal-cookie": "^4.0.4",
"yup": "^0.32.11" "yup": "^0.32.11"
},
"dependencies": {
"buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
}
}
} }
}, },
"cliui": { "cliui": {

8
server/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
# syntax=docker/dockerfile:1
FROM node:16-alpine
WORKDIR /app
COPY ["package.json", "./"]
RUN npm install
COPY . .
EXPOSE 3001/tcp
CMD npm run start