-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
76 lines (69 loc) · 1.82 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
version: "3.4"
# NOTE: This _has _to start with `x-`
x-logging: &default-logging
options:
max-size: "20k"
max-file: "10"
services:
django:
build:
context: .
dockerfile: docker/Dockerfile.backend
command: uvicorn asgi:application --host 0.0.0.0 --port 8000 --reload
environment:
# To make things play nice with dj-database-url
- DATABASE_URL=postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
env_file: .env
volumes:
- ./src/backend:/app
- ./src/frontend/build:/frontend:delegated
ports:
- 8000:8000
depends_on:
- db
stdin_open: true
tty: true
logging: *default-logging
db:
image: postgres:13-alpine
env_file: .env
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_PASSWORD=${DB_PASSWORD}
ports:
- 5432:5432
volumes:
- db_data:/var/lib/postgresql/data:delegated
logging: *default-logging
builder:
build:
context: .
dockerfile: docker/Dockerfile.frontend
command: bash -c "yarn && yarn run dev"
env_file: .env
environment:
- HOST=0.0.0.0
ports:
- 3000:3000
volumes:
- ./src/frontend:/app:cached
# This _deletes_ the node_modules/ host volume folder in docker, so it uses the docker image
# node_modules/ -- if you modify yarn.lock you'll need to build the docker image again.
- /app/node_modules
depends_on:
- django
logging: *default-logging
redis:
image: redis
env_file: .env
ports:
- 6379:6379
logging: *default-logging
volumes:
- ./volumes/redis:/data
- ./docker/redis.conf:/redis.conf
- ./docker/sysctl.conf:/etc/sysctl.conf
restart: unless-stopped
command: redis-server /redis.conf --bind 0.0.0.0
volumes:
db_data: