Skip to content

Commit f07346f

Browse files
committed
chore: move docker-compose from README.md to standalone
1 parent 5e8884f commit f07346f

2 files changed

Lines changed: 59 additions & 59 deletions

File tree

README.md

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -27,64 +27,9 @@ If you have `SERVER_PROXY_PORT` set to `8000` in your `.env` file, you can find
2727

2828
## Deployment
2929

30-
Create a `.env` file from `.env.example.prod` and complete it with the necessary information. If you only want to use data availability for one protocol, comment out the other.
30+
Create a `.env` file from `.env.example.prod` and complete it with the necessary information. If you only want to use data availability for one protocol, comment out the other.
3131

32-
You can then run the whole project with below example `docker-compose.yaml`.
33-
34-
```yaml
35-
x-django: &django
36-
image: ghcr.io/flare-foundation/data-availability:latest
37-
env_file:
38-
- .env
39-
restart: unless-stopped
40-
41-
services:
42-
db:
43-
image: postgres:16
44-
restart: unless-stopped
45-
environment:
46-
POSTGRES_DB: ${DB_NAME}
47-
POSTGRES_USER: ${DB_USER}
48-
POSTGRES_PASSWORD: ${DB_PASSWORD}
49-
healthcheck:
50-
test: ["CMD-SHELL", "pg_isready", "-d", "${DB_NAME}"]
51-
interval: 10s
52-
timeout: 5s
53-
retries: 5
54-
volumes:
55-
- pg_data:/var/lib/postgresql/data
56-
57-
django:
58-
<<: *django
59-
ports:
60-
- "127.0.0.1:${SERVER_PROXY_PORT}:8000"
61-
healthcheck:
62-
test: ["CMD", "curl", "--fail", "http://localhost:8000/api/health"]
63-
interval: 10s
64-
timeout: 5s
65-
retries: 5
66-
depends_on:
67-
db:
68-
condition: service_healthy
69-
70-
process-ftso-data:
71-
<<: *django
72-
command: python manage.py process_ftso_data
73-
depends_on:
74-
db:
75-
condition: service_healthy
76-
django:
77-
condition: service_healthy
78-
79-
process-fdc-data:
80-
<<: *django
81-
command: python manage.py process_fdc_data
82-
depends_on:
83-
db:
84-
condition: service_healthy
85-
django:
86-
condition: service_healthy
87-
88-
volumes:
89-
pg_data:
32+
```
33+
docker compose pull
34+
docker compose up -d
9035
```

docker-compose.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
x-django: &django
2+
image: ghcr.io/flare-foundation/data-availability:latest
3+
env_file:
4+
- .env
5+
restart: unless-stopped
6+
7+
services:
8+
db:
9+
image: postgres:16
10+
restart: unless-stopped
11+
environment:
12+
POSTGRES_DB: ${DB_NAME}
13+
POSTGRES_USER: ${DB_USER}
14+
POSTGRES_PASSWORD: ${DB_PASSWORD}
15+
healthcheck:
16+
test: ["CMD-SHELL", "pg_isready", "-d", "${DB_NAME}"]
17+
interval: 10s
18+
timeout: 5s
19+
retries: 5
20+
volumes:
21+
- pg_data:/var/lib/postgresql/data
22+
23+
django:
24+
<<: *django
25+
ports:
26+
- "127.0.0.1:${SERVER_PROXY_PORT}:8000"
27+
healthcheck:
28+
test: ["CMD", "curl", "--fail", "http://localhost:8000/api/health"]
29+
interval: 10s
30+
timeout: 5s
31+
retries: 5
32+
depends_on:
33+
db:
34+
condition: service_healthy
35+
36+
process-ftso-data:
37+
<<: *django
38+
command: python manage.py process_ftso_data
39+
depends_on:
40+
db:
41+
condition: service_healthy
42+
django:
43+
condition: service_healthy
44+
45+
process-fdc-data:
46+
<<: *django
47+
command: python manage.py process_fdc_data
48+
depends_on:
49+
db:
50+
condition: service_healthy
51+
django:
52+
condition: service_healthy
53+
54+
volumes:
55+
pg_data:

0 commit comments

Comments
 (0)