-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yaml
128 lines (118 loc) · 3.67 KB
/
docker-compose-prod.yaml
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
volumes:
db-data:
static_volume:
services:
# ----------------------------------------------------------------------------
# nginx proxy server
# ----------------------------------------------------------------------------
nginx:
# container_name: nginx
build:
context: .
dockerfile: ./settings/docker/Dockerfile.nginx
ports:
- 1337:80
depends_on:
- frontend-service
volumes:
- static_volume:/usr/share/nginx/html/static
# ----------------------------------------------------------------------------
# nuxt frontend
# ----------------------------------------------------------------------------
frontend-service:
# container_name: nuxt-frontend
build:
context: .
dockerfile: ./settings/docker/Dockerfile.frontend
command: "npm run dev"
expose:
- 3000
- 24678:24678
volumes:
- ./frontend:/app
env_file:
- ./settings/env/.env.frontend.dev
# ----------------------------------------------------------------------------
# django backend
# ----------------------------------------------------------------------------
backend-service:
# container_name: django-backend
build:
context: .
dockerfile: ./settings/docker/Dockerfile.backend
expose:
- 8000
volumes:
- ./backend:/app
- static_volume:/app/static
env_file:
- ./settings/env/.env.backend.dev
depends_on:
- db_postgres
command: >
sh -c "./run_before.sh
&& pipenv run gunicorn -c gunicorn.py backend.wsgi"
# ----------------------------------------------------------------------------
# database
# ----------------------------------------------------------------------------
db_postgres:
image: postgres
# container_name: db_postgres
# restart: always
expose:
- 5432
volumes:
- db-data:/var/lib/postgresql/data
env_file:
- ./settings/env/.env.backend.dev
# ----------------------------------------------------------------------------
# adminer
# ----------------------------------------------------------------------------
adminer:
image: adminer
# restart: always
# container_name: adminer
depends_on:
- db_postgres
ports:
- 8080:8080
environment:
ADMINER_DEFAULT_SERVER: db_postgres
# sh -c "pipenv run gunicorn 'backend.wsgi' -b :8000 --timeout 120 --workers=3 --threads=3 --worker-connections=1000"
# sh -c "pipenv run ./manage.py runserver 0.0.0.0:8000"
# sh -c "pipenv run gunicorn 'backend.wsgi' --bind=0.0.0.0:8000 --timeout 600"
# command: >
# sh -c "pipenv sync &&
# pipenv run gunicorn 'hh.wsgi' --bind=0.0.0.0:8000"
# The commented out section below is an example of how to define a PostgreSQL
# database that your application can use. `depends_on` tells Docker Compose to
# start the database before your application. The `db-data` volume persists the
# database data between container restarts. The `db-password` secret is used
# to set the database password. You must create `db/password.txt` and add
# a password of your choosing to it before running `docker compose up`.
# depends_on:
# db:
# condition: service_healthy
# db:
# image: postgres
# restart: always
# user: postgres
# secrets:
# - db-password
# volumes:
# - db-data:/var/lib/postgresql/data
# environment:
# - POSTGRES_DB=example
# - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
# expose:
# - 5432
# healthcheck:
# test: [ "CMD", "pg_isready" ]
# interval: 10s
# timeout: 5s
# retries: 5
# volumes:
# db-data:
# secrets:
# db-password:
# file: db/password.txt