-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.edit.yml
68 lines (65 loc) · 1.74 KB
/
docker-compose.edit.yml
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
---
# This version of the docker compose file allows testing of database changes and migrations
# It launches a postgres container and the fragalysis image, mounting your current directory into the container
# It does not build the Neo4j graph.
# To use:
# 1. Build a backend image
# $ export BE_NAMESPACE=xchem
# $ docker build . -t xchem/fragalysis-backend:latest
#
# 2. Run docker-compose to start a database and a backend
# $ docker-compose -f docker-compose.edit.yml up
#
# 3. Enter the backend container and create new migrations
# $ docker exec -it fragalysis-backend_edit_1 bash
# # python manage.py makemigrations
#
# 4. Commit new migrations!
#
# Hints:
# - To try out a migration here:
# # python manage.py migrate
#
# - To rerun a migration you need to --fake back to the last good one:
# # python manage.py migrate --fake viewer 0016_auto_20211005_1420
# # python manage.py migrate
#
version: '3'
services:
database:
image: postgres:12.16-alpine3.18
volumes:
- ../django_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: fragalysis
POSTGRES_DB: frag
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
healthcheck:
test: pg_isready -U postgres -d frag
interval: 10s
timeout: 2s
retries: 5
start_period: 10s
edit:
image: ${BE_NAMESPACE}/fragalysis-backend:latest
command:
- tail
- -f
- /dev/null
volumes:
- .:/code
- ../logs:/code/logs/
- ../media:/code/media/
environment:
POSTGRESQL_DATABASE: frag
POSTGRESQL_USER: postgres
POSTGRESQL_PASSWORD: fragalysis
POSTGRESQL_HOST: database
POSTGRESQL_PORT: 5432
ports:
- "80:80"
depends_on:
database:
condition: service_healthy