-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add production ready VaaS instance in docker-compose (#512)
* PLUTON-19054 | add docker-compose base * Update vaas/vaas/resources/base-data.yaml Co-authored-by: awmackowiak <[email protected]> * Update docs/quick-start/docker_compose.md Co-authored-by: awmackowiak <[email protected]> * Update docs/quick-start/docker_compose.md Co-authored-by: awmackowiak <[email protected]> --------- Co-authored-by: ziollek <[email protected]> Co-authored-by: awmackowiak <[email protected]>
- Loading branch information
1 parent
51b19fd
commit d98e9a3
Showing
20 changed files
with
333 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
services: | ||
celery-worker: | ||
entrypoint: [ '/entrypoint-celery-worker.sh' ] | ||
env_file: ./envs/dev.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-cron-worker: | ||
entrypoint: [ '/entrypoint-celery-cron-worker.sh' ] | ||
env_file: ./envs/dev.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-routes-test: | ||
entrypoint: [ '/entrypoint-celery-routes-test.sh' ] | ||
env_file: ./envs/dev.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
uwsgi: | ||
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi-dev.sh' ] | ||
env_file: ./envs/dev.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-scheduler: | ||
entrypoint: ['/wait-for-it.sh', 'uwsgi:3030', '-t', '60', '--', '/entrypoint-celery-scheduler.sh' ] | ||
env_file: ./envs/dev.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
|
||
# Varnishes & nginx | ||
nginx-0: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.10 | ||
nginx-1: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.11 | ||
nginx-2: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.12 | ||
nginx-3: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.13 | ||
nginx-4: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.14 | ||
nginx-5: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.15 | ||
varnish-4.1: | ||
build: ./docker/varnish-4.1 | ||
image: allegro/vaas-varnish-4.1 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.4 | ||
varnish-6.0.2: | ||
build: ./docker/varnish-6.0.2 | ||
image: allegro/vaas-varnish-6.0.2 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.6 | ||
varnish-7.0: | ||
build: ./docker/varnish-7.0 | ||
image: allegro/vaas-varnish-7.0 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.7 | ||
networks: | ||
vaas: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 192.168.199.0/24 | ||
gateway: 192.168.199.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,131 +1,41 @@ | ||
services: | ||
celery-worker: | ||
entrypoint: [ '/entrypoint-celery-worker.sh' ] | ||
env_file: ./envs/dev.env | ||
env_file: ./envs/base.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-cron-worker: | ||
entrypoint: [ '/entrypoint-celery-cron-worker.sh' ] | ||
env_file: ./envs/dev.env | ||
env_file: ./envs/base.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-routes-test: | ||
entrypoint: [ '/entrypoint-celery-routes-test.sh' ] | ||
env_file: ./envs/dev.env | ||
env_file: ./envs/base.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
uwsgi: | ||
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi-dev.sh' ] | ||
env_file: ./envs/dev.env | ||
entrypoint: ['/wait-for-it.sh', 'mysql:3306', '-t', '30', '--', '/entrypoint-uwsgi.sh' ] | ||
env_file: ./envs/base.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
celery-scheduler: | ||
entrypoint: ['/wait-for-it.sh', 'uwsgi:3030', '-t', '60', '--', '/entrypoint-celery-scheduler.sh' ] | ||
env_file: ./envs/dev.env | ||
env_file: ./envs/base.env | ||
volumes: | ||
- ./vaas:/home/app/vaas | ||
- ./plugins:/home/app/plugins | ||
networks: | ||
- vaas | ||
- default | ||
|
||
# Varnishes & nginx | ||
nginx-0: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.10 | ||
nginx-1: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.11 | ||
nginx-2: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.12 | ||
nginx-3: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.13 | ||
nginx-4: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.14 | ||
nginx-5: | ||
build: ./docker/nginx | ||
image: vaas-nginx | ||
expose: | ||
- "80" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.15 | ||
varnish-4.1: | ||
build: ./docker/varnish-4.1 | ||
image: allegro/vaas-varnish-4.1 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.4 | ||
varnish-6.0.2: | ||
build: ./docker/varnish-6.0.2 | ||
image: allegro/vaas-varnish-6.0.2 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.6 | ||
varnish-7.0: | ||
build: ./docker/varnish-7.0 | ||
image: allegro/vaas-varnish-7.0 | ||
expose: | ||
- "6082" | ||
- "6081" | ||
networks: | ||
vaas: | ||
ipv4_address: 192.168.199.7 | ||
networks: | ||
vaas: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- subnet: 192.168.199.0/24 | ||
gateway: 192.168.199.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Collect static files" | ||
python /home/app/vaas/manage.py collectstatic --no-input | ||
|
||
echo "Migrating" | ||
python /home/app/vaas/manage.py migrate --run-syncdb | ||
|
||
echo "Loading base-data" | ||
python /home/app/vaas/manage.py loaddata ./vaas/resources/base-data.yaml | ||
|
||
echo "Install the test requirements to allow [manage.py test] to be called within the container" | ||
pip install -r /home/app/vaas/requirements/base.txt | ||
|
||
echo "Start uwsgi server" | ||
exec uwsgi --ini /etc/uwsgi.cfg --http-socket :3030 |
Oops, something went wrong.