docker-compose.yml 1.47 KB
version: '3'
services:
  xg-login-admin:
    build: .
    command: gunicorn -c deployment/gunicorn.py app:app
    container_name: xg-login-admin
    environment:
      FLASK_APP: app.py
      FLASK_ENV: production
      CONFIG_NAME: qcloud
      SCRIPT_NAME: xg-login
    ports:
      - '5000:5000'
    volumes:
      - .:/var/www/xg-login-admin
      - /data/:/data/
    depends_on:
      - redis
      - postgres
    links:
      - redis
      - postgres
    network_mode: bridge

  celery:
    build: .
    command: python run_celery.py worker -l info --beat -c 4
    container_name: xg-login-celery
    environment:
      FLASK_APP: app.py
      FLASK_ENV: production
      CONFIG_NAME: qcloud
    volumes:
      - .:/var/www/xg-login-admin
    depends_on:
      - redis
      - postgres
    links:
      - redis
      - postgres
    network_mode: bridge

  redis:
    image: redis
    restart: always
    hostname: redis
    container_name: redis
    network_mode: bridge
    ports:
      - '63791:6379'
    command: redis-server /usr/local/etc/redis/redis.conf
    volumes:
      - ./deployment/redis.conf:/usr/local/etc/redis/redis.conf
      - /data/redis/:/data/

  postgres:
    image: postgres:latest
    restart: always
    container_name: postgres
    environment:
      POSTGRES_PASSWORD: intern
      POSTGRES_USER: intern
      POSTGRES_DB: ios_mockgateway_api
    volumes:
      - ./db:/docker-entrypoint-initdb.d
      - /data/postgres/:/var/lib/postgresql/data
    network_mode: bridge