-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
85 lines (79 loc) · 3 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
# DO NOT FORGET TO CONFIGURE NGINX ON HOST.
# Nginx configuration sample found inside ./synker.conf
# Run named pipes in background ---> docker-compose up -d && ((while true; do eval "$(cat ./pipes)"; done) &) && docker-compose logs -f --tail 10
# ---> Kill all provisioned CodeServer instances from the command line using docker-compose ====> docker-compose exec django python manage.py shell -c "from core.models import CodeServerPort as CSP; CSP.kill_all()"
version: "3.2"
services:
static:
image: nginx:latest
ports:
- "2999:80"
volumes:
- "./synker.conf:/etc/nginx/conf.d/default.conf"
- "./statics:/usr/share/nginx/html/static"
# - "/etc/nginx/snippets/:/etc/nginx/snippets/"
# - "/etc/ssl/private:/etc/ssl/private"
# - "/etc/ssl/certs/nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt"
# - "/etc/nginx/dhparam.pem:/etc/nginx/dhparam.pem"
django:
depends_on:
- static
build: ./django-app/
volumes:
- type: bind
source: "./django-app"
target: "/synker"
- type: bind
source: "./statics"
target: "/statics"
- type: bind # binds to a folder on host where repos are synced into. See settings.py for more.
source: "./repositories"
target: "/repositories"
# # DooD
# - type: bind
# source: "/var/run/docker.sock"
# target: "/var/run/docker.sock" # this requires more investigation as it is unsercure https://blog.nestybox.com/2019/09/14/dind.html#docker-out-of-docker-dood, https://www.lvh.io/posts/dont-expose-the-docker-socket-not-even-to-a-container/
- "./pipes:/hostpipe"
ports:
- "3000:3000"
env_file:
- './.env'
environment:
- APP_HOST_DIR=$PWD
command: bash -c 'python manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --no-input && gunicorn --bind :3000 --workers 3 --reload synker.wsgi:application'
# command: bash -c 'gunicorn --bind :3000 --workers 3 --reload synker.wsgi:application'
background-sync:
restart: always
depends_on:
- django
build: ./django-app/
env_file:
- './.env'
volumes:
- type: bind
source: "./django-app"
target: "/synker"
- type: bind # binds to a folder on host where repos are synced into. See settings.py for more.
source: "./repositories"
target: "/repositories"
command: bash -c 'python manage.py shell -c "from sync_utils.runner import run; run()"'
apache-php:
# image: php:7.4-apache
build: ./apache-php
ports:
- "3001:80"
volumes:
- type: bind
source: './repositories'
target: '/var/www/html'
# volumes:
# - "./php.ini:/usr/local/etc/php/conf.d/mysql.ini"
companydir-db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: tutor
MYSQL_PASSWORD: tutor
MYSQL_DATABASE: companydirectory
volumes:
- "./companydirectory.sql:/docker-entrypoint-initdb.d/cd.sql"