-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy pathcompose.yaml
More file actions
112 lines (103 loc) · 3.69 KB
/
Copy pathcompose.yaml
File metadata and controls
112 lines (103 loc) · 3.69 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: wevoteserver
services:
db:
environment:
- POSTGRES_USER=${DATABASE_USER:-postgres}
- POSTGRES_DB=${DATABASE_NAME:-wevoteserverdb}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- PGPASSWORD=${DATABASE_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
image: postgres:16-alpine
networks:
- wevote
ports:
- "127.0.0.1:5432:5432" # to allow postgres clients on the host machine to connect to the database at localhost:5432
user: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- /tmp/docker:/tmp # Needed to get backup files into psql to test fastback
localstack:
image: localstack/localstack:4.14.0
networks:
- wevote
volumes:
- localstack:/var/lib/localstack
- ./docker/dev/localstack-init.sh:/etc/localstack/init/ready.d/init.sh
environment:
PERSISTENCE: 1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4566/_localstack/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
api:
extra_hosts:
- ${WE_VOTE_SERVER_DOMAIN_HTTP:-localhost}:0.0.0.0
- ${WE_VOTE_SERVER_DOMAIN_HTTPS:-wevotedeveloper.com}:0.0.0.0
build:
dockerfile: docker/Dockerfile.dev
depends_on:
db:
condition: service_healthy
localstack:
condition: service_healthy
# Note: DATABASE_HOST=db does not indicate the name of the host, it is used to associate the api service with the db service
environment:
- DATABASE_NAME=${DATABASE_NAME:-wevoteserverdb}
- DATABASE_NAME_READONLY=${DATABASE_NAME:-wevoteserverdb}
- DATABASE_HOST=db
- DATABASE_HOST_READONLY=db
- DATABASE_USER=${DATABASE_USER:-postgres}
- DATABASE_USER_READONLY=${DATABASE_USER:-postgres}
- DATABASE_PASSWORD=${DATABASE_PASSWORD:-admin}
- DATABASE_PASSWORD_READONLY=${DATABASE_PASSWORD:-admin}
- DATABASE_PORT=${DATABASE_PORT:-5432}
- DATABASE_PORT_READONLY=${DATABASE_PORT:-5432}
- DJANGO_SUPERUSER_EMAIL
- DJANGO_SUPERUSER_PASSWORD
- AWS_ENDPOINT_URL=http://localstack:4566
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_DEFAULT_REGION=us-east-1
- AWS_SQS_WEB_QUEUE_URL=http://localstack:4566/000000000000/job-queue.fifo
- PYDEVD_DISABLE_FILE_VALIDATION=1
- WE_VOTE_SERVER_PROTOCOL=${WE_VOTE_SERVER_PROTOCOL:-http}
- WE_VOTE_SERVER_DOMAIN_HTTP=${WE_VOTE_SERVER_DOMAIN_HTTP:-localhost}
- WE_VOTE_SERVER_DOMAIN_HTTPS=${WE_VOTE_SERVER_DOMAIN_HTTPS:-wevotedeveloper.com}
- WE_VOTE_SERVER_PORT=${WE_VOTE_SERVER_PORT:-8000}
- DEV_SERVER_SSL_CERT=${DEV_SERVER_SSL_CERT:-cert/wevotedeveloper.com.crt}
- DEV_SERVER_SSL_KEY=${DEV_SERVER_SSL_KEY:-cert/wevotedeveloper.com_key.txt}
volumes:
- .:/wevote/code
- /tmp/docker:/tmp # Needed to get backfiles into psql to test fastback
networks:
- wevote
ports:
- "0.0.0.0:8000:8000" # WeVote API at http://localhost:8000 or https://wevotedeveloper.com:8000
- "127.0.0.1:5678:5678" # debugpy port for remote debugging
pgadmin:
image: dpage/pgadmin4:8.4
environment:
PGADMIN_DEFAULT_EMAIL: ${PG_ADMIN_EMAIL:-fake_email@wevoteeducation.org}
PGADMIN_DEFAULT_PASSWORD: ${PG_ADMIN_PASSWORD:-admin}
DATABASE_USER: ${DATABASE_USER:-postgres}
DATABASE_PASSWORD: ${DATABASE_PASSWORD:-admin}
volumes:
- pgadmin_data:/var/lib/pgadmin
ports:
- "0.0.0.0:8080:80"
networks:
- wevote
networks:
wevote:
name: wevote
external: true
volumes:
localstack:
postgres_data:
pgadmin_data: