Merge pull request #20 from gdevenyi/fix-docker-compose
Fix docker-compose
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
@@ -8,10 +6,9 @@ services:
|
|||||||
container_name: worklenz_frontend
|
container_name: worklenz_frontend
|
||||||
ports:
|
ports:
|
||||||
- "4200:4200"
|
- "4200:4200"
|
||||||
volumes:
|
depends_on:
|
||||||
- ./worklenz-frontend:/app
|
backend:
|
||||||
networks:
|
condition: service_started
|
||||||
- worklenz_network
|
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
@@ -21,28 +18,55 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://worklenz_user:worklenz_password@db:5432/worklenz_db
|
- ANGULAR_DIST_DIR
|
||||||
volumes:
|
- ANGULAR_SRC_DIR
|
||||||
- ./worklenz-backend:/app
|
- AWS_REGION
|
||||||
networks:
|
- BACKEND_PUBLIC_DIR
|
||||||
- worklenz_network
|
- BACKEND_VIEWS_DIR
|
||||||
|
- COMMIT_BUILD_IMMEDIATELY
|
||||||
|
- COOKIE_SECRET
|
||||||
|
- DB_HOST
|
||||||
|
- DB_MAX_CLIENTS
|
||||||
|
- DB_NAME
|
||||||
|
- DB_PASSWORD
|
||||||
|
- DB_PORT
|
||||||
|
- DB_USER
|
||||||
|
- GOOGLE_CALLBACK_URL
|
||||||
|
- GOOGLE_CLIENT_ID
|
||||||
|
- GOOGLE_CLIENT_SECRET
|
||||||
|
- HOSTNAME
|
||||||
|
- LOGIN_FAILURE_REDIRECT
|
||||||
|
- NODE_ENV
|
||||||
|
- PORT
|
||||||
|
- SESSION_NAME
|
||||||
|
- SESSION_SECRET
|
||||||
|
- SLACK_WEBHOOK
|
||||||
|
- SOCKET_IO_CORS
|
||||||
|
- SOURCE_EMAIL
|
||||||
|
- USE_PG_NATIVE
|
||||||
|
- BUCKET
|
||||||
|
- REGION
|
||||||
|
- S3_URL
|
||||||
|
- S3_ACCESS_KEY_ID
|
||||||
|
- S3_SECRET_ACCESS_KEY
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:15.6
|
image: postgres:15
|
||||||
container_name: worklenz_db
|
container_name: worklenz_db
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: worklenz_user
|
POSTGRES_DB: "${DB_NAME}"
|
||||||
POSTGRES_PASSWORD: worklenz_password
|
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
||||||
POSTGRES_DB: worklenz_db
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -d ${DB_NAME} -U ${DB_USER}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- worklenz_postgres_data:/var/lib/postgresql/data
|
||||||
networks:
|
- ./worklenz-backend/database/:/docker-entrypoint-initdb.d
|
||||||
- worklenz_network
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
worklenz_postgres_data:
|
||||||
|
|
||||||
networks:
|
|
||||||
worklenz_network:
|
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ RUN npm install -g @angular/cli
|
|||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["npm", "run", "start-docker"]
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --proxy-config proxy.config.json --disable-host-check",
|
"start": "ng serve --proxy-config proxy.config.json --disable-host-check",
|
||||||
|
"start-docker": "ng serve --proxy-config proxy-docker.config.json --disable-host-check --host 0.0.0.0",
|
||||||
"build": "ng build --extract-licenses --common-chunk --delete-output-path --output-hashing=all",
|
"build": "ng build --extract-licenses --common-chunk --delete-output-path --output-hashing=all",
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
|
|||||||
24
worklenz-frontend/proxy-docker.config.json
Normal file
24
worklenz-frontend/proxy-docker.config.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"/api": {
|
||||||
|
"target": "http://backend:3000/",
|
||||||
|
"headers": {
|
||||||
|
"language": "en",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json; charset=utf-8"
|
||||||
|
},
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"logLevel": "debug"
|
||||||
|
},
|
||||||
|
"/secure": {
|
||||||
|
"target": "http://backend:3000/",
|
||||||
|
"headers": {
|
||||||
|
"language": "en",
|
||||||
|
"Accept": "application/json",
|
||||||
|
"Content-Type": "application/json; charset=utf-8"
|
||||||
|
},
|
||||||
|
"secure": false,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"logLevel": "debug"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user