-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose-development.yml
109 lines (104 loc) · 3.58 KB
/
docker-compose-development.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
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
# Docker Compose File for Development / Single Machine Deployments
# Creates an Nginx, Django, and Postgres container that work
# together.
version: "3"
networks:
frontend:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.0.0/24
backend:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.1.0/24
services:
# Create a Django container. Note that no secrets should
# be stored within the container, but passed in via
# environment variables.
presqt_django:
command: "docker/django_entrypoint.sh"
build:
context: .
dockerfile: django.dockerfile
# "Build Args" don't persist into the running
# container, so we prefix them with BUILD to
# make this clear.
args:
BUILD_ENVIRONMENT: ${ENVIRONMENT:-production}
ports:
- 127.0.0.1:8000:8000
environment:
CURATE_ND_TEST_TOKEN: $CURATE_ND_TEST_TOKEN
GITHUB_TEST_USER_TOKEN: $GITHUB_TEST_USER_TOKEN
GITLAB_TEST_USER_TOKEN: $GITLAB_TEST_USER_TOKEN
GITLAB_UPLOAD_TEST_USER_TOKEN: $GITLAB_UPLOAD_TEST_USER_TOKEN
OSF_TEST_USER_TOKEN: $OSF_TEST_USER_TOKEN
OSF_PRIVATE_USER_TOKEN: $OSF_PRIVATE_USER_TOKEN
OSF_UPLOAD_TEST_USER_TOKEN: $OSF_UPLOAD_TEST_USER_TOKEN
OSF_PRESQT_FORK_TOKEN: $OSF_PRESQT_FORK_TOKEN
ZENODO_TEST_USER_TOKEN: $ZENODO_TEST_USER_TOKEN
FIGSHARE_TEST_USER_TOKEN: $FIGSHARE_TEST_USER_TOKEN
SECRET_KEY: $SECRET_KEY
ENVIRONMENT: ${ENVIRONMENT:-production}
DJANGO_SETTINGS_MODULE: config.settings.${ENVIRONMENT:-production}
EMAIL_HOST_USER: ${EMAIL_HOST_USER:-NA}
FAIRSHAKE_TOKEN: ${FAIRSHAKE_TOKEN:-NA}
restart: always
volumes:
- .:/usr/src/app
- presqt_static_volume:/usr/src/app/staticfiles
- presqt_media_volume:/usr/src/app/mediafiles
networks:
- frontend
- backend
# Since only one service should be running
# per container, we need something separate
# to run scheduled jobs.
presqt_cron:
command: "docker/cron_startup.sh"
restart: always
depends_on:
- presqt_django
build:
context: .
dockerfile: django.dockerfile
args:
BUILD_ENVIRONMENT: ${ENVIRONMENT:-production}
environment:
CURATE_ND_TEST_TOKEN: $CURATE_ND_TEST_TOKEN
GITHUB_TEST_USER_TOKEN: $GITHUB_TEST_USER_TOKEN
GITLAB_TEST_USER_TOKEN: $GITLAB_TEST_USER_TOKEN
GITLAB_UPLOAD_TEST_USER_TOKEN: $GITLAB_UPLOAD_TEST_USER_TOKEN
OSF_TEST_USER_TOKEN: $OSF_TEST_USER_TOKEN
OSF_PRIVATE_USER_TOKEN: $OSF_PRIVATE_USER_TOKEN
OSF_UPLOAD_TEST_USER_TOKEN: $OSF_UPLOAD_TEST_USER_TOKEN
OSF_PRESQT_FORK_TOKEN: $OSF_PRESQT_FORK_TOKEN
ZENODO_TEST_USER_TOKEN: $ZENODO_TEST_USER_TOKEN
FIGSHARE_TEST_USER_TOKEN: $FIGSHARE_TEST_USER_TOKEN
SECRET_KEY: $SECRET_KEY
ENVIRONMENT: ${ENVIRONMENT:-production}
DJANGO_SETTINGS_MODULE: config.settings.${ENVIRONMENT:-production}
EMAIL_HOST_USER: ${EMAIL_HOST_USER:-NA}
FAIRSHAKE_TOKEN: ${FAIRSHAKE_TOKEN:-NA}
volumes:
- .:/usr/src/app
- presqt_static_volume:/usr/src/app/staticfiles
- presqt_media_volume:/usr/src/app/mediafiles
- ./config/cron/crontabs/${ENVIRONMENT:-production}.crontab:/etc/crontabs/root
networks:
- backend
# We create two top-level networks to provide some isolation
# of concerns / greater security. In our case, we use this to
# disallow direct connections between the NGINX container and
# the Postgres container.
networks:
frontend:
backend:
volumes:
presqt_static_volume:
presqt_media_volume:
presqt_ui_volume: