-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
151 lines (129 loc) · 4.25 KB
/
docker-compose.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: '3.7'
services:
backend:
build:
context: ./packages/backend/
dockerfile: Dockerfile.dev
command: npm run docker:dev
depends_on:
- db
volumes:
- './packages/backend/:/code/'
# Persist installed node_modules into a named volume.
- 'api_node_modules_data:/code/node_modules'
# Below is how you must create the docker-compose in production
# Mount each required directory and file independently instead of mounting
# the entire current directory. Otherwise the `node_modules` directory
# from the developer's machine is mounted into the container as well.
# There is no guarantee that this machine is running the same architecture
# as the container's image. In that case, packages with C code compiled on
# the machine, such as bcrypt, might not work in the container.
# - './packages/backend/package.json:/code/package.json'
# - './packages/backend/package-lock.json:/code/package-lock.json'
# - './packages/backend/tsconfig.json:/code/tsconfig.json:ro'
environment:
DATABASE_NAME: clug-db
DATABASE_HOST: db
DATABASE_PORT: 5432
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: .Clug-123
JWT_SECRET: iE1oP/5tO0H9knqiqqaOvXQGDGyRSx0BxxnbkD7Lhzw=
DATABASE_DROPSCHEMA: "false"
DATABASE_SYNCHRONIZE: "true"
ports:
- 3001:3001
frontend:
build:
context: ./packages/frontend/
dockerfile: Dockerfile.dev
tty: true
command: npm run start
volumes:
- './packages/frontend/:/code/'
# Persist installed node_modules into a named volume.
- 'frontend_node_modules_data:/code/node_modules'
# Below is how you must create the docker-compose in production
# Mount each required directory and file independently instead of mounting
# the entire current directory. Otherwise the `node_modules` directory
# from the developer's machine is mounted into the container as well.
# There is no guarantee that this machine is running the same architecture
# as the container's image. In that case, packages with C code compiled on
# the machine, such as bcrypt, might not work in the container.
# - './packages/frontend/public:/code/public'
# - './packages/frontend/package.json:/code/package.json'
# - './packages/frontend/package-lock.json:/code/package-lock.json'
# - './packages/frontend/tsconfig.json:/code/tsconfig.json:ro'
links:
- backend
ports:
- 3000:3000
restart: always
backoffice:
build:
context: ./packages/backoffice/
dockerfile: Dockerfile.dev
tty: true
command: npm run start
volumes:
- './packages/backoffice/:/code/'
# Persist installed node_modules into a named volume.
- 'backoffice_node_modules_data:/code/node_modules'
links:
- backend
ports:
- 3002:3000
- 3010:3010
restart: always
db:
image: postgres:12-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: .Clug-123
POSTGRES_DB: clug-db
restart: always
volumes:
# Persist data in a named volume. Run `docker-compose down -v` to
# permanently delete it.
- "db_data:/var/lib/postgresql/data"
adminer:
image: adminer
restart: always
ports:
- 8080:8080
localstack-s3:
image: localstack/localstack:latest
container_name: localstack-s3
ports:
- '4566:4566'
environment:
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_DEFAULT_REGION=eu-west-1
- EDGE_PORT=4566
- SERVICES=s3
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
- DOCKER_HOST=unix:///var/run/docker.sock
volumes:
- ./.localstack:/tmp/localstack
- ./docker/aws:/docker-entrypoint-initaws.d
volumes:
db_data:
api_node_modules_data:
driver: local
driver_opts:
type: none
o: bind
device: ./packages/backend/node_modules
frontend_node_modules_data:
driver: local
driver_opts:
type: none
o: bind
device: ./packages/frontend/node_modules
backoffice_node_modules_data:
driver: local
driver_opts:
type: none
o: bind
device: ./packages/backoffice/node_modules