-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
61 lines (58 loc) · 1.42 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
---
services:
app:
build:
context: ./src/app
dockerfile: Dockerfile
target: environment
working_dir: /usr/local/src
environment:
- PORT=4321
volumes:
- ./src/app:/usr/local/src
- node-modules-volume:/usr/local/src/node_modules
command: npm run dev --host
ports:
- 4321:4321
database:
image: postgis/postgis:13-3.1
environment:
- POSTGRES_USER=$THIRDPLACES
- POSTGRES_PASSWORD=$THIRDPLACES
- POSTGRES_DB=$THIRDPLACES
healthcheck:
test: ["CMD", "pg_isready", "-U", "$THIRDPLACES", "-h", "database"]
interval: 1s
timeout: 30s
retries: 30
django:
image: python:3.10-slim
env_file: .env
environment:
- PGHOST=database
- PGPORT=5432
- PGUSER=$THIRDPLACES
- PGPASSWORD=$THIRDPLACES
- PGDATABASE=$THIRDPLACES
- DJANGO_ENV=Development
- DJANGO_SECRET_KEY=secret
- DJANGO_LOG_LEVEL=INFO
- DJANGO_ALLOWED_HOSTS=localhost,django
build:
context: ./src/django
dockerfile: Dockerfile
labels:
com.project.name: "third-places"
volumes:
- ./src/django:/usr/local/src
working_dir: /usr/local/src
depends_on:
database:
condition: service_healthy
command: >
bash -c
"python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8321"
ports:
- 8321:8321
volumes:
node-modules-volume: