-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
76 lines (73 loc) · 3.11 KB
/
docker-compose.dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
version: "3.7"
services:
backend:
build: backend
command: yarn start:debug
container_name: choreScheduler-backend
environment:
BACKEND_PORT: $BACKEND_PORT
env_file:
- .development.env
working_dir: /usr/src/app
volumes:
- ./backend:/usr/src/app
- backend-deps:/usr/src/app/node_modules
- ./prettier.config.js:/usr/src/prettier.config.js
- ./.eslintrc.js:/usr/src/.eslintrc.js
- ./backend/node_modules:/usr/src/app/node_modules
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
- 9229:9229
networks:
- choreScheduler
frontend:
build: frontend
command: yarn dev
container_name: choreScheduler-frontend
environment:
- FRONTEND_PORT=$FRONTEND_PORT
- CHOKIDAR_USEPOLLING=true
env_file:
- .development.env
working_dir: /usr/src/app
volumes:
# This line defines a bind mount volume. It mounts the ./frontend directory on your local machine to the
# /usr/src/app directory inside the container. This allows any files or directories in the ./frontend directory on your
# local machine to be accessible inside the container at /usr/src/app. Changes made in the local ./frontend directory
# will be immediately visible inside the container.
- ./frontend:/usr/src/app
# This line defines a named volume. It creates a Docker volume named frontend-deps and mounts it to the
# /usr/src/app/node_modules directory inside the container. Named volumes are managed by Docker and provide a persistent
# storage solution that survives container restarts. In this case, it allows the node_modules directory inside the
# container to persist even if the container is removed or recreated. This volume is typically used to store the
# installed dependencies for your project, allowing you to avoid reinstalling them every time the container starts.
- frontend-deps:/usr/src/app/node_modules
- ./prettier.config.js:/usr/src/prettier.config.js
- ./.eslintrc.js:/usr/src/.eslintrc.js
# Mounts the node_modules directory from your local machine's ./frontend directory to the /usr/src/app/node_modules
# directory inside the container. This volume configuration allows the container to access and use the node_modules
# directory from your local machine. This configuration is commonly used during development to avoid the overhead of
# reinstalling dependencies inside the container. It will keep the node_modules of the container in sync with the local
# so that whenever we install a new package, we don't have to rebuild the containers.
- ./frontend/node_modules:/usr/src/app/node_modules
ports:
- ${FRONTEND_PORT}:${FRONTEND_PORT}
networks:
- choreScheduler
database:
image: postgres:15.0-alpine3.16
restart: always
container_name: choreScheduler-database
environment:
DATABASE_PORT: $DATABASE_PORT
env_file:
- .development.env
ports:
- ${DATABASE_PORT}:${DATABASE_PORT}
networks:
- choreScheduler
volumes:
frontend-deps:
backend-deps:
networks:
choreScheduler: