-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (79 loc) · 1.45 KB
/
docker-compose.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
version: "3.7"
services:
# The app running the web presentation layer.
web:
build:
context: ./app
target: web
networks:
- app
volumes:
- ./app/src/:/app/src
depends_on:
- db
- redis
environment:
- PGHOST=db
- PGUSER=devnews
- PGPASSWORD=devnews
- PGDATABASE=devnews
env_file:
- app/.env
# The app running the API presentation layer.
api:
build:
context: ./app
target: api
networks:
- app
volumes:
- ./app/src/:/app/src
depends_on:
- db
environment:
- PGHOST=db
- PGUSER=devnews
- PGPASSWORD=devnews
- PGDATABASE=devnews
env_file:
- app/.env
# PostgreSQL database.
db:
image: postgres:13-alpine
networks:
- app
volumes:
- ./db/:/docker-entrypoint-initdb.d:ro
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=devnews
- POSTGRES_USER=devnews
# Redis for sessions.
redis:
image: redis:6-alpine
networks:
- app
# Nginx for serving with HTTPS.
nginx:
image: nginx:alpine
networks:
- app
depends_on:
- web
- api
ports:
# Web ports
- 8080:80
- 8443:443
# API ports
- 8081:81
- 8444:444
volumes:
- ./nginx/:/etc/nginx/conf.d:ro
- ./app/static/:/static:ro
networks:
app:
driver: bridge
volumes:
db-data:
driver: local