-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (106 loc) · 3.34 KB
/
docker-compose.yml
File metadata and controls
113 lines (106 loc) · 3.34 KB
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
include:
- ./langpro-container/compose.yaml
services:
nginx:
container_name: la-nginx
restart: unless-stopped
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- 127.0.0.1:5000:80
postgres:
container_name: la-postgres
image: postgres:15
restart: unless-stopped
environment:
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- POSTGRES_DB=$POSTGRES_DB
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- 127.0.0.1:5433:5432
backend-prod: &backend-prod
container_name: la-backend
image: la-backend-prod
profiles: ["prod"]
build: ./backend
restart: unless-stopped
environment:
- PGHOST=postgres
- PGUSER=$POSTGRES_USER
- PGPASSWORD=$POSTGRES_PASSWORD
- PGDATABASE=$POSTGRES_DB
- DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY
- LANGPRO_CONTAINER=http://langpro:80
- DJANGO_DEBUG=0
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: "curl -f localhost:8000/admin/"
volumes:
- ./logs/django:/usr/src/app/logs
- ./seed/:/usr/src/app/backend/problem/data
command: >
gunicorn langpro_annotator.wsgi:application
-w 4
-b 0.0.0.0:8000
--timeout 600
--access-logfile /usr/src/app/logs/access_log
--error-logfile /usr/src/app/logs/error_log
--capture-output
backend-dev:
<<: *backend-prod
image: la-backend-dev
restart: no
profiles: ["dev"]
environment:
- PGHOST=postgres
- LANGPRO_CONTAINER=http://langpro:80
- DJANGO_DEBUG=1
volumes:
- ./backend:/usr/src/app
ports:
- 127.0.0.1:8000:8000
command: sh -c "python manage.py check && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
frontend-dev:
image: la-frontend-dev
container_name: la-frontend
restart: no
profiles: ["dev"]
build:
context: ./frontend
dockerfile: Dockerfile.dev
healthcheck:
test: "curl -f localhost:4200"
expose:
- 4200
- 9876
volumes:
- ./frontend:/usr/src/app
- frontend-node-modules:/usr/src/app/node_modules
- frontend-angular-cache:/usr/src/app/.angular
ports:
- 127.0.0.1:4200:4200
- 127.0.0.1:9876:9876
frontend-prod:
image: la-frontend-prod
container_name: la-frontend
restart: unless-stopped
profiles: ["prod"]
build:
context: ./frontend
dockerfile: Dockerfile.prod
args:
APP_VERSION: ${APP_VERSION:-0.0.0}
SOURCE_URL: https://github.com/CentreForDigitalHumanities/langpro-annotator
healthcheck:
test: "curl -f localhost:4200"
volumes:
postgres-data:
frontend-node-modules:
frontend-angular-cache: