-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.production.yml
58 lines (57 loc) · 1.34 KB
/
docker-compose.production.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
version: '3'
services:
webapp:
env_file:
- ./.env
volumes:
- ./webapp:/usr/src/app
- ./logs:/var/logs/
- staticfiles:/usr/src/app/staticfiles
- mediafiles:/usr/src/app/mediafiles
build:
context: ./webapp
dockerfile: ./Dockerfile.production
image: webapp-image
container_name: webapp-container
entrypoint:
- /docker-entrypoint.sh
depends_on:
- db
nginx:
build:
context: ./nginx
dockerfile: ./Dockerfile.production
image: nginx-image
container_name: nginx-container
ports:
- 80:80
depends_on:
- webapp
links:
- webapp
entrypoint:
- /docker-entrypoint.sh
volumes:
- staticfiles:/static
- mediafiles:/media
- ./logs:/var/log/nginx
db:
image: postgres
expose:
- "${POSTGRES_PORT}"
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
volumes:
- ./db/initial_setup.sql:/docker-entrypoint-initdb.d/initial_setup.sql
- postgres_data:/var/lib/postgresql/data/
command: -p ${POSTGRES_PORT}
volumes:
postgres_data:
staticfiles:
mediafiles: