-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
109 lines (103 loc) · 2.47 KB
/
docker-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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: "2.1"
services:
db:
image: postgres:12-alpine
container_name: replant-db
restart: on-failure
ports:
- "5432:5432"
volumes:
- ./.postgres-data/:/var/lib/postgresql/data/
environment:
POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
interval: 10s
timeout: 5s
retries: 10
migrations:
build: ./backend/
image: replant-backend
container_name: replant-migrations
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgresql://postgres@db/postgres
entrypoint: /bin/sh
command:
[
"-c",
"python manage.py migrate && python manage.py loaddata fixtures.json",
]
depends_on:
db:
condition: service_healthy
api:
build: ./backend/
image: replant-backend
container_name: replant-api
restart: on-failure
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgresql://postgres@db/postgres
ports:
- '8001:8000'
volumes:
- ./backend/:/app/
- /app/static
- /app/node_modules
command: python manage.py runserver 0.0.0.0:8000
depends_on:
migrations:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "http://localhost:8000/api/status"]
interval: 30s
timeout: 5s
retries: 5
mint-forever:
build: ./backend/
image: replant-backend
container_name: replant-mint-forever
restart: on-failure
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgresql://postgres@db/postgres
volumes:
- ./backend/:/app/
- /app/static
- /app/node_modules
command: python manage.py mint_forever
depends_on:
migrations:
condition: service_completed_successfully
upload-app:
build:
context: upload-app/
target: base
image: replant-upload-app
profiles: ["frontend"]
container_name: replant-upload-app
restart: on-failure
volumes:
- ./upload-app/:/app/
- /app/node_modules
ports:
- "5173:5173"
command: npm run dev
marketplace-app:
build:
context: marketplace-app/
target: base
image: replant-marketplace-app
profiles: ["frontend"]
container_name: replant-marketplace-app
restart: on-failure
volumes:
- ./marketplace-app/:/app/
- /app/node_modules
ports:
- "5174:5174"
command: npm run dev