Skip to content

Commit

Permalink
separated docker-compose files into dev and prod in preparation for C…
Browse files Browse the repository at this point in the history
…I/CD (#75)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* phase 2 partial ------ 3 (#73)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* domain setup step 1 test 5

* domain setup step 2(backend) test 1

* domain setup step2(backend) test2

* removed .ssl-data from .dockerignore

* added custom nginx container to handle reverse proxying and https requests

* made important changes to deploy_frontend.sh, added google tracking code to index.html, enabled crawling

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed bug that occurs when user submit google drive video link (#72)

* added functionality to format youtube video url to embedable format

* made video url optional

* switched image upload location from cloudinary to digital ocean spaces

* added functionality to automatically delete image from digitalocean space once image is deleted from db

* added image count indicator and made video optional. also added project create button to navbar

* removed .ssl from git

* untracked .ssl-data

* added support for various forms of youtube video url, vimeo and google drive

* fixed issues #35, #33, #32, #30, #29

* fixed issue #46

* phase2 patial ----- 2 (#66)

* added description to the video url field in project creation form issue #50 (#61)

* new deployment changes (#62)

* increased pagination limit from 6 to 20 (#63)

* phase2 patial ----- 2 (#65)

switched handling of ssl back to valian/docker-nginx-auto-ssl

* fixed issue #68

* separated docker-compose files into dev and prod in preparation for CI/CD

* separated docker-compose files into dev and prod in preparation for CI/CD -- backend
  • Loading branch information
NdibeRaymond authored Jan 17, 2021
1 parent 8fcdce5 commit b754415
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 45 deletions.
2 changes: 1 addition & 1 deletion zubhub_backend/deploy_backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ cp -r zubhub/zubhub_backend/ zubhub_backend/
rm -rf zubhub/ zubhub_backend/.env.example
cd zubhub_backend
docker-compose down
docker-compose up -d --build
docker-compose -f ./docker-compose.prod.yml up -d --build
echo "Updated backend"
# EOT
124 changes: 124 additions & 0 deletions zubhub_backend/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
version: "3.3"

services:
web:
env_file: .env
build:
context: .
dockerfile: ./Dockerfile
command: /start
restart: on-failure
environment:
- ENVIRONMENT=${ENVIRONMENT}
- SECRET_KEY:${SECRET_KEY}
- DEBUG:${DEBUG}
- POSTGRES_NAME=${POSTGRES_NAME}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=${POSTGRES_HOST}
- SENDGRID_API_KEY=${SENDGRID_API_KEY}
volumes:
- .:/zubhub_backend
ports:
- 8000
depends_on:
- db
- rabbitmq

db:
env_file: .env
image: postgres:11
restart: on-failure
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
ports:
- 5432

reverse-proxy:
image: valian/docker-nginx-auto-ssl:1.0.0
container_name: reverse-proxy
restart: on-failure
ports:
- 80:80
- 443:443
volumes:
- ./.ssl-data:/etc/resty-auto-ssl
environment:
ALLOWED_DOMAINS: "(api|www.api|rabbitmq|flower|prometheus).zubhub.unstructured.studio"
SITES:
"api.zubhub.unstructured.studio=web:8000;www.api.zubhub.unstructured.studio=web:8000;\
rabbitmq.zubhub.unstructured.studio=rabbitmq:15672;flower.zubhub.unstructured.studio=flower:5555;\
prometheus.zubhub.unstructured.studio=prometheus:9090"
FORCE_HTTPS: "true"
depends_on:
- web
- rabbitmq
- flower
- prometheus

rabbitmq:
env_file: .env
image: rabbitmq:3-management
restart: on-failure
ports:
- 5672
- 15672

celery_worker:
env_file: .env
build:
context: .
dockerfile: ./Dockerfile
image: zubhub_celery_worker
command: /start-celeryworker
restart: on-failure
volumes:
- .:/zubhub_backend
depends_on:
- rabbitmq
- db

flower:
env_file: .env
build:
context: .
dockerfile: ./Dockerfile
image: zubhub_celery_flower
ports:
- 5555
command: /start-flower
restart: on-failure
volumes:
- .:/zubhub_backend
depends_on:
- celery_worker
- rabbitmq
- db

prometheus:
image: prom/prometheus
ports:
- 9090
command:
- --config.file=/etc/prometheus/prometheus.yml
restart: on-failure
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- cadvisor

cadvisor:
image: google/cadvisor
container_name: cadvisor
restart: on-failure
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro

volumes:
postgres_data:
.ssl-data:
23 changes: 0 additions & 23 deletions zubhub_backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,6 @@ services:
ports:
- 5432:5432

reverse-proxy:
image: valian/docker-nginx-auto-ssl:1.0.0
container_name: reverse-proxy
restart: on-failure
ports:
- 80:80
- 443:443
volumes:
- ./.ssl-data:/etc/resty-auto-ssl
environment:
ALLOWED_DOMAINS: "(api|www.api|rabbitmq|flower|prometheus).zubhub.unstructured.studio"
SITES:
"api.zubhub.unstructured.studio=web:8000;www.api.zubhub.unstructured.studio=web:8000;\
rabbitmq.zubhub.unstructured.studio=rabbitmq:15672;flower.zubhub.unstructured.studio=flower:5555;\
prometheus.zubhub.unstructured.studio=prometheus:9090"
FORCE_HTTPS: "true"
depends_on:
- web
- rabbitmq
- flower
- prometheus

rabbitmq:
env_file: .env
image: rabbitmq:3-management
Expand Down Expand Up @@ -121,4 +99,3 @@ services:

volumes:
postgres_data:
.ssl-data:
2 changes: 1 addition & 1 deletion zubhub_frontend/zubhub/deploy_frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ cp -r zubhub/zubhub_frontend/ zubhub_frontend/
rm -rf zubhub/ zubhub_frontend/zubhub/.env.example
cd zubhub_frontend/zubhub/
docker-compose down
docker-compose up -d --build
docker-compose -f ./docker-compose.prod.yml up -d --build
echo "Updated frontend"
# EOT
32 changes: 32 additions & 0 deletions zubhub_frontend/zubhub/docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "3.3"

services:
zubhub_frontend:
container_name: zubhub_frontend
build:
context: .
dockerfile: Dockerfile
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
restart: on-failure
ports:
- "80"

reverse-proxy:
image: valian/docker-nginx-auto-ssl:1.0.0
container_name: reverse-proxy
restart: on-failure
ports:
- 80:80
- 443:443
volumes:
- ./.ssl-data:/etc/resty-auto-ssl
environment:
ALLOWED_DOMAINS: "(zubhub|www.zubhub).unstructured.studio"
SITES: "zubhub.unstructured.studio=zubhub_frontend;www.zubhub.unstructured.studio=zubhub_frontend"
FORCE_HTTPS: "true"
depends_on:
- zubhub_frontend

volumes:
.ssl-data:
21 changes: 1 addition & 20 deletions zubhub_frontend/zubhub/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,4 @@ services:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
restart: on-failure
ports:
- "8080:80"

reverse-proxy:
image: valian/docker-nginx-auto-ssl:1.0.0
container_name: reverse-proxy
restart: on-failure
ports:
- 80:80
- 443:443
volumes:
- ./.ssl-data:/etc/resty-auto-ssl
environment:
ALLOWED_DOMAINS: "(zubhub|www.zubhub).unstructured.studio"
SITES: "zubhub.unstructured.studio=zubhub_frontend;www.zubhub.unstructured.studio=zubhub_frontend"
FORCE_HTTPS: "true"
depends_on:
- zubhub_frontend

volumes:
.ssl-data:
- "80:80"

0 comments on commit b754415

Please sign in to comment.