Home

Docker for stack nginx-uwsgi-mongo

version: '3.5'

networks:
  backend:

volumes:
  pyenv:
  sockets:
  mongo-data:
  mongo-config:

services:
  pyruntime:
    image: bkinno/uwsgi:latest
    volumes:
      - ./back/requirements.txt:/tmp/requirements.txt
      - pyenv:/pyenv
    environment:
      PYTHONUSERBASE: /pyenv
    command: pip install -r /tmp/requirements.txt --user --upgrade

  nginx:
    image: nginx:alpine
    ports:
      - "1984:1984"
    volumes:
      - ./deploy/tekkool.nginx.conf:/etc/nginx/conf.d/tekkool.conf
      - sockets:/sockets
    depends_on:
      - back
    networks:
      - backend
    command: nginx -g 'daemon off;'

  back:
    image: bkinno/uwsgi:latest
    volumes:
      - ./back:/back
      - ./deploy/tekkool.uwsgi.ini:/uwsgi/tekkool.ini
      - pyenv:/pyenv
      - sockets:/sockets
    working_dir: /back
    ports:
      - '5000:5000'
    networks:
      - backend
    depends_on:
      - mongo
    environment:
        PYTHONPATH: /back
        PYTHONUSERBASE: /pyenv
    command: uwsgi --ini /uwsgi/tekkool.ini

  mongo:
    image: mongo:latest
    expose:
      - '27017'
    volumes:
      - mongo-data:/data/db
      - mongo-config:/data/configdb
    networks:
      - backend

comments powered by Disqus