-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.production.yml
More file actions
161 lines (148 loc) · 4.36 KB
/
docker-compose.production.yml
File metadata and controls
161 lines (148 loc) · 4.36 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
volumes:
production_postgres_data: {}
production_postgres_data_backups: {}
production_traefik: {}
production_django_media: {}
production_redis_data: {}
jupyterhub_data: {}
services:
django: &django
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: spectrumx_visualization_platform_production_django
networks:
- spectrumx_network
volumes:
- production_django_media:/app/spectrumx_visualization_platform/media
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
command: /start
frontend:
build:
context: ./frontend
dockerfile: ../compose/production/frontend/Dockerfile
networks:
- spectrumx_network
volumes:
- ./frontend:/app
depends_on:
- django
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: spectrumx_visualization_platform_production_postgres
networks:
- spectrumx_network
volumes:
- production_postgres_data:/var/lib/postgresql/data
- production_postgres_data_backups:/backups
env_file:
- ./.envs/.production/.postgres
traefik:
build:
context: .
dockerfile: ./compose/production/traefik/Dockerfile
image: spectrumx_visualization_platform_production_traefik
networks:
- spectrumx_network
depends_on:
- django
volumes:
- source: ./compose/production/traefik/data/certs
target: /etc/traefik/certs
type: bind
read_only: true
- source: ./compose/production/traefik/traefik.yml
target: /etc/traefik/traefik.yml
type: bind
read_only: true
- source: ./compose/production/traefik/credentials.htpasswd
target: /etc/traefik/dashboard/credentials.htpasswd
type: bind
read_only: true
ports:
- '0.0.0.0:80:80'
- '0.0.0.0:443:443'
- '0.0.0.0:5555:5555'
# whoami service to test traefik reachability
# curl --insecure https://whoami.spectrumx-qa.crc.nd.edu
whoami:
image: traefik/whoami
networks:
- spectrumx_network
command:
- --port=2001 # must match port in traefik.yml
# - --name=sds-01
# networks:
# - sds-network-local
redis:
image: docker.io/redis:6
networks:
- spectrumx_network
volumes:
- production_redis_data:/data
celeryworker:
<<: *django
image: spectrumx_visualization_platform_production_celeryworker
command: /start-celeryworker
celerybeat:
<<: *django
image: spectrumx_visualization_platform_production_celerybeat
command: /start-celerybeat
flower:
<<: *django
image: spectrumx_visualization_platform_production_flower
command: /start-flower
nginx:
build:
context: .
dockerfile: ./compose/production/nginx/Dockerfile
image: spectrumx_visualization_platform_production_nginx
networks:
- spectrumx_network
depends_on:
- django
volumes:
- production_django_media:/usr/share/nginx/media:ro
jupyter:
build:
context: .
dockerfile: ./compose/production/jupyter/Dockerfile
args:
JUPYTERHUB_VERSION: latest
restart: always
image: jupyterhub
container_name: jupyterhub
networks:
- spectrumx_network
volumes:
- './compose/production/jupyter/jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py:ro'
- '/var/run/docker.sock:/var/run/docker.sock:rw'
- 'jupyterhub_data:/data'
userns_mode: 'host' # needs to match UID of the host machine in order to access the Docker socket
user: root # docker socket requires root user
environment:
JUPYTERHUB_ADMIN: admin
JUPYTERHUB_HOST: svi-qa.crc.nd.edu/notebook
DOCKER_NETWORK_NAME: spectrumx_network
DOCKER_NOTEBOOK_IMAGE: quay.io/jupyter/base-notebook:latest
DOCKER_NOTEBOOK_DIR: /home/jovyan/work
# Add these environment variables for network configuration
HUB_IP: jupyter
DOCKER_JUPYTER_CONTAINER: jupyter
# Ensure the network is created with the full name
COMPOSE_PROJECT_NAME: spectrumx_visualization_platform_production
ports:
- '8888:8000'
env_file:
- ./.envs/.production/.jupyterhub
networks:
# run ./compose/create-network.sh first to create this network
spectrumx_network:
external: true