Skip to content

Commit

Permalink
docker-compose update (support nginx ;))
Browse files Browse the repository at this point in the history
  • Loading branch information
MaKyOtOx committed Oct 5, 2018
1 parent 9813855 commit df48007
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
35 changes: 12 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
version: '3.6'
version: '3.7'
services:

rabbitmq:
image: rabbitmq:latest
container_name: patrowl_rabbitmq
environment:
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-rabbit log_levels [{connection,error}]"
- RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=-rabbit log_levels [{connection,error}]
ports:
- '5672:5672'

db:
# image: postgres:latest
image: postgres:10.1-alpine
container_name: patrowl_postgres
environment:
Expand All @@ -23,18 +22,6 @@ services:
- ./var/db/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
# volumes:
# - postgres_data:/var/lib/postgresql/data/
#
# nginx:
# image: nginx:latest
# restart: always
# container_name: patrowl_nginx
# ports:
# - "18000:18000"
# links:
# - web:web
# volumes:
# - ./:/opt/patrowl-manager/
# - ./nginx_docker.conf:/etc/nginx/conf.d/default.conf

web:
container_name: patrowl_django
Expand All @@ -46,17 +33,19 @@ services:
depends_on:
- db
- rabbitmq
# volumes:
# - ./:/opt/patrowl-manager/
ports:
- "0.0.0.0:8001:8001"
links:
- db
- rabbitmq

# start_dependencies:
# image: dadarek/wait-for-dependencies
# depends_on:
# - db
# - rabbitmq
# command: db:5432 rabbitmq:5672
nginx:
image: nginx:latest
container_name: patrowl_nginx
ports:
- "8080:8080"
volumes:
- ./:/opt/patrowl-manager/
- ./nginx_docker.conf:/etc/nginx/conf.d/default.conf
depends_on:
- web
5 changes: 3 additions & 2 deletions nginx_docker.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80;
listen 8080;
autoindex on;
server_name localhost;

Expand All @@ -9,7 +9,8 @@ server {
error_log /opt/patrowl-manager/var/log/nginx.patrowlmanager-error.log;

location / {
proxy_pass http://127.0.0.1:8000;
#proxy_pass http://127.0.0.1:8001;
proxy_pass http://web:8001;
}

location /static {
Expand Down
3 changes: 2 additions & 1 deletion start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ else
echo -e "supervisord stopped. Starting supervisord."
supervisord -c var/etc/supervisord.conf
fi
python manage.py makemigrations && python manage.py migrate && python manage.py runserver_plus 0.0.0.0:8000
#python manage.py makemigrations && python manage.py migrate && python manage.py runserver_plus 0.0.0.0:8000
gunicorn app.wsgi:application -b :8000
deactivate

0 comments on commit df48007

Please sign in to comment.