forked from wevote/WeVoteServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
87 lines (82 loc) · 2.2 KB
/
compose.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
name: wevote
services:
db:
build:
context: .
dockerfile: ./docker/Dockerfile.db
tags:
- "${COMPOSE_PROJECT_NAME}-db:latest"
container_name: "${COMPOSE_PROJECT_NAME}-db"
environment:
POSTGRES_DB: WeVoteServerDB
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secret}
env_file: .env
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ${COMPOSE_PROJECT_NAME}
ports:
- "127.0.0.1:5432:5432"
restart: unless-stopped
user: postgres
volumes:
- "${COMPOSE_PROJECT_NAME}-postgres-data:/var/lib/postgresql/data"
localstack:
container_name: "${COMPOSE_PROJECT_NAME}-localstack"
depends_on:
db:
condition: service_healthy
restart: true
environment:
DOCKER_HOST: unix:///var/run/docker.sock
image: localstack/localstack
networks:
- ${COMPOSE_PROJECT_NAME}
ports:
- "127.0.0.1:4566:4566"
profiles:
- optional
volumes:
- "${COMPOSE_PROJECT_NAME}-localstack:/var/lib/localstack"
- /var/run/docker.sock:/var/run/docker.sock
api:
build:
context: .
dockerfile: ./docker/Dockerfile.api
tags:
- "${COMPOSE_PROJECT_NAME}-api:latest"
container_name: "${COMPOSE_PROJECT_NAME}-api"
depends_on:
db:
condition: service_healthy
restart: true
environment:
DATABASE_HOST: "${COMPOSE_PROJECT_NAME}-db"
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-secret}
DATABASE_PORT: "5432"
DJANGO_SUPERUSER_EMAIL: ${DJANGO_SUPERUSER_EMAIL:-dev@test.com}
DJANGO_SUPERUSER_PASSWORD: ${DJANGO_SUPERUSER_PASSWORD:-secret}
env_file: .env
networks:
- ${COMPOSE_PROJECT_NAME}
ports:
- "127.0.0.1:8000:8000"
volumes:
- "./:/${COMPOSE_PROJECT_NAME}"
working_dir: "/${COMPOSE_PROJECT_NAME}"
networks:
wevote:
ipam:
config:
- subnet: "172.27.0.0/16"
gateway: "172.27.0.1"
name: ${COMPOSE_PROJECT_NAME}
volumes:
wevote-localstack:
name: "${COMPOSE_PROJECT_NAME}-localstack"
wevote-postgres-data:
name: "${COMPOSE_PROJECT_NAME}-postgres-data"