Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- celery:
- image: newswall
- container_name: celery_newswall
- working_dir: /app
- command: bash -c "celery -A newswallproj worker -l info"
- volumes:
- - ./src:/app
- env_file:
- - .env
- links:
- - db
- - redis
- depends_on:
- - redis
- - web
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- celery_beat:
- image: newswall
- container_name: celerybeat_newswall
- working_dir: /app
- command: bash -c "celery -A newswallproj.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler"
- volumes:
- - ./src:/app
- env_file:
- - .env
- links:
- - db
- - redis
- depends_on:
- - redis
- - web
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- celery_flower:
- image: newswall
- container_name: celeryflower_newswall
- working_dir: /app
- ports:
- ##################### Change on production ###################
- - "8081:8081"
- command: flower -A newswallproj --port=8081 --basic_auth="${CELERY_FLOWER_USER:?err}:${CELERY_FLOWER_PASSWORD:?err}"
- volumes:
- - ./src:/app
- depends_on:
- - redis
- - celery
- - celery_beat
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- db:
- image: postgres:9.6
- container_name: db_newswall
- hostname: db
- env_file:
- - .env
- build:
- context: config/db
- dockerfile: Dockerfile
- volumes:
- - db-data:/var/lib/postgresql/data
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- redis:
- image: redis:latest
- container_name: redis_newswall
- hostname: redis
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- nginx:
- image: nginx:latest
- container_name: nginx_newswall
- ports:
- - "8080:80"
- volumes:
- - ./src:/app
- - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
- depends_on:
- - web
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- web:
- build:
- context: .
- dockerfile: Dockerfile
- image: newswall
- container_name: django_newswall
- hostname: web
- command: bash -c "rm -f celerybeat.pid && ls && python manage.py migrate news --database=default --noinput && python manage.py migrate tracking --database=tracking --noinput && python manage.py migrate --noinput && python manage.py initadmin && python manage.py collectstatic --noinput && gunicorn newswallproj.wsgi:application --workers 1 --bind unix:/app/newswallproj.sock"
- volumes:
- - ./src:/app
- env_file:
- - .env
- links:
- - db
- - redis
- depends_on:
- - db
- restart: always
- logging:
- driver: "json-file"
- options:
- max-size: "20m"
- max-file: "20"
- volumes:
- db-data:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement