Skip to content

Commit ff80672

Browse files
authored
Merge pull request #20 from gdevenyi/fix-docker-compose
Fix docker-compose
2 parents 104f04f + d0235ed commit ff80672

File tree

4 files changed

+73
-24
lines changed

4 files changed

+73
-24
lines changed

docker-compose.yml

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
services:
42
frontend:
53
build:
@@ -8,10 +6,9 @@ services:
86
container_name: worklenz_frontend
97
ports:
108
- "4200:4200"
11-
volumes:
12-
- ./worklenz-frontend:/app
13-
networks:
14-
- worklenz_network
9+
depends_on:
10+
backend:
11+
condition: service_started
1512

1613
backend:
1714
build:
@@ -21,28 +18,55 @@ services:
2118
ports:
2219
- "3000:3000"
2320
depends_on:
24-
- db
21+
db:
22+
condition: service_healthy
2523
environment:
26-
- DATABASE_URL=postgres://worklenz_user:worklenz_password@db:5432/worklenz_db
27-
volumes:
28-
- ./worklenz-backend:/app
29-
networks:
30-
- worklenz_network
24+
- ANGULAR_DIST_DIR
25+
- ANGULAR_SRC_DIR
26+
- AWS_REGION
27+
- BACKEND_PUBLIC_DIR
28+
- BACKEND_VIEWS_DIR
29+
- COMMIT_BUILD_IMMEDIATELY
30+
- COOKIE_SECRET
31+
- DB_HOST
32+
- DB_MAX_CLIENTS
33+
- DB_NAME
34+
- DB_PASSWORD
35+
- DB_PORT
36+
- DB_USER
37+
- GOOGLE_CALLBACK_URL
38+
- GOOGLE_CLIENT_ID
39+
- GOOGLE_CLIENT_SECRET
40+
- HOSTNAME
41+
- LOGIN_FAILURE_REDIRECT
42+
- NODE_ENV
43+
- PORT
44+
- SESSION_NAME
45+
- SESSION_SECRET
46+
- SLACK_WEBHOOK
47+
- SOCKET_IO_CORS
48+
- SOURCE_EMAIL
49+
- USE_PG_NATIVE
50+
- BUCKET
51+
- REGION
52+
- S3_URL
53+
- S3_ACCESS_KEY_ID
54+
- S3_SECRET_ACCESS_KEY
3155

3256
db:
33-
image: postgres:15.6
57+
image: postgres:15
3458
container_name: worklenz_db
3559
environment:
36-
POSTGRES_USER: worklenz_user
37-
POSTGRES_PASSWORD: worklenz_password
38-
POSTGRES_DB: worklenz_db
60+
POSTGRES_DB: "${DB_NAME}"
61+
POSTGRES_PASSWORD: "${DB_PASSWORD}"
62+
healthcheck:
63+
test: ["CMD-SHELL", "pg_isready -d ${DB_NAME} -U ${DB_USER}"]
64+
interval: 10s
65+
timeout: 5s
66+
retries: 5
3967
volumes:
40-
- postgres_data:/var/lib/postgresql/data
41-
networks:
42-
- worklenz_network
68+
- worklenz_postgres_data:/var/lib/postgresql/data
69+
- ./worklenz-backend/database/:/docker-entrypoint-initdb.d
4370

4471
volumes:
45-
postgres_data:
46-
47-
networks:
48-
worklenz_network:
72+
worklenz_postgres_data:

worklenz-frontend/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ RUN npm install -g @angular/cli
88

99
RUN npm install
1010

11-
CMD ["npm", "start"]
11+
CMD ["npm", "run", "start-docker"]

worklenz-frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve --proxy-config proxy.config.json --disable-host-check",
7+
"start-docker": "ng serve --proxy-config proxy-docker.config.json --disable-host-check --host 0.0.0.0",
78
"build": "ng build --extract-licenses --common-chunk --delete-output-path --output-hashing=all",
89
"watch": "ng build --watch --configuration development",
910
"test": "ng test",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"/api": {
3+
"target": "http://backend:3000/",
4+
"headers": {
5+
"language": "en",
6+
"Accept": "application/json",
7+
"Content-Type": "application/json; charset=utf-8"
8+
},
9+
"secure": false,
10+
"changeOrigin": true,
11+
"logLevel": "debug"
12+
},
13+
"/secure": {
14+
"target": "http://backend:3000/",
15+
"headers": {
16+
"language": "en",
17+
"Accept": "application/json",
18+
"Content-Type": "application/json; charset=utf-8"
19+
},
20+
"secure": false,
21+
"changeOrigin": true,
22+
"logLevel": "debug"
23+
}
24+
}

0 commit comments

Comments
 (0)