-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
47 lines (44 loc) · 1.3 KB
/
docker-compose.yaml
File metadata and controls
47 lines (44 loc) · 1.3 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
services:
db:
image: postgres:15
container_name: postgres-cryptotrendanalyzer
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-cryptotrendanalyzer}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- cryptotrendanalyzer-db:/var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
networks:
- cryptotrendanalyzer-net
cryptotrendanalyzer-api:
image: cryptotrendanalyzer-api:latest
container_name: cryptotrendanalyzer-api
depends_on:
- db
env_file:
- app/.env
command: sh -c "pipenv run python manage.py collectstatic --noinput &&
pipenv run python manage.py makemigrations --noinput &&
pipenv run python manage.py migrate --noinput &&
pipenv run python manage.py load_market_data &&
pipenv run python manage.py runserver 0.0.0.0:8000"
volumes:
- ./app:/app
ports:
- "8000:8000"
networks:
- cryptotrendanalyzer-net
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/api/healthcheck || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: on-failure
networks:
cryptotrendanalyzer-net:
volumes:
cryptotrendanalyzer-db: