<commit_before>#
# Production server with UWSGI configured to run on port 8080
#
# Usage:
# fig -f fig-.yml <command>
#
# Typical useage:
#
# fig build
# fig up -d web
#
# See accompanying Make commands for easy collectstatic etc.
# Our main nginx service
nginx:
  image: nginx
  hostname: nginx
  volumes:
    - ./nginx-conf:/etc/nginx/conf.d
  ports:
    - "80:80"

# Our docker-gen service reloads nginx with dynamically generated
# templates each time a container is brought up / down
# See https://registry.hub.docker.com/u/jwilder/nginx-proxy/
# This one uses a template for nginx proxying (see above for http)
#
# Note: Currently this is experimental and not being used.
#
dockergen:
  image: jwilder/docker-gen
  hostname: docker-gen
  volumes_from:
    - nginx
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock
    - ./nginx-templates:/etc/docker-gen/templates
  # see https://github.com/jwilder/docker-gen/blob/master/README.md#usage
  command: -notify-sighup deployment_nginx_1 -watch -only-exposed /etc/docker-gen/templates/nginx-uwsgi.tmpl /etc/nginx/conf.d/uwsgi-proxies.conf

smtp:
  image: catatnight/postfix
  hostname: postfix
  environment:
    # You could change this to something more suitable
    - maildomain=kartoza.com
    - smtp_user=noreply:docker

db:
  image: kartoza/postgis
  volumes:
    - ./pg/postgres_data:/var/tasks/postgresql
  environment:
    - USERNAME=docker
    - PASS=docker

qgisserver:
  image: kartoza/qgis-server
  hostname: qgis-server
  volumes:
    - ../maps:/web
    - ./logs/qgisserver:/var/log/apache2
  links:
    - db:db

mapproxy:
  image: kartoza/mapproxy
  hostname: mapproxy
  volumes:
    - ../mapproxy:/mapproxy
  volumes_from:
    - qgisserver
  links:
    - qgisserver:qgisserver

rabbitmq:
  image: library/rabbitmq
  hostname: rabbitmq
  environment:
     - RABBIT_PASSWORD=<PASSWORD>
     - USER=rabbit_user
     - RABBITMQ_NODENAME=rabbit

uwsgi:
  build: docker-prod
  hostname: uwsgi
  environment:
    - DATABASE_NAME=gis
    - DATABASE_USERNAME=docker
    - DATABASE_PASSWORD=docker
    - DATABASE_HOST=db
    - RABBITMQ_HOST=rabbitmq
    - DJANGO_SETTINGS_MODULE=core.settings.prod_docker
    - VIRTUAL_HOST=watchkeeper.kartoza.org
    - VIRTUAL_PORT=8080
  volumes:
    - ../django_project:/home/web/django_project
    - ./static:/home/web/static
    - ./media:/home/web/media
    - ./reports:/home/web/reports
    - ./logs:/var/log/
  links:
    - smtp:smtp
    - db:db
    - rabbitmq:rabbitmq

worker:
  build: docker-prod
  hostname: worker
  command: celery worker -A event_mapper.celeryconf -l info
  environment:
    - DATABASE_NAME=gis
    - DATABASE_USERNAME=docker
    - DATABASE_PASSWORD=<PASSWORD>
    - DATABASE_HOST=db
    - RABBITMQ_HOST=rabbitmq
    - DJANGO_SETTINGS_MODULE=core.settings.prod_docker
    - VIRTUAL_HOST=watchkeeper.kartoza.org
    - VIRTUAL_PORT=8080
  volumes:
    - ../django_project:/home/web/django_project
    - ./static:/home/web/static
    - ./media:/home/web/media
    - ./reports:/home/web/reports
    - ./logs:/var/log/
  links:
    - smtp:smtp
    - db:db
    - rabbitmq:rabbitmq

cron:
  build: docker-cron
  hostname: cron
  environment:
    - PGPASSWORD=<PASSWORD>
    - PGUSER=docker
    - PGPORT=5432
    - PGHOST=db
    - PGDATABASE=gis
  volumes:
    - ../maps:/home/web/maps
    - ./reports:/home/web/reports
    - ./cron-scripts:/home/web/cron-scripts
    - /tmp/.X11-unix:/tmp/.X11-unix
  links:
    - db:db

web:
  image: nginx
  hostname: nginx
  volumes:
    - ./sites-enabled:/etc/nginx/conf.d:ro
    # I dont use volumes_from as I want to use the ro modifier
    - ./static:/home/web/static:ro
    - ./media:/home/web/media:ro
    - ./logs:/var/log/nginx<commit_msg>Remove crons<commit_after>#
# Production server with UWSGI configured to run on port 8080
#
# Usage:
# fig -f fig-.yml <command>
#
# Typical useage:
#
# fig build
# fig up -d web
#
# See accompanying Make commands for easy collectstatic etc.
# Our main nginx service
nginx:
  image: nginx
  hostname: nginx
  volumes:
    - ./nginx-conf:/etc/nginx/conf.d
  ports:
    - "80:80"

# Our docker-gen service reloads nginx with dynamically generated
# templates each time a container is brought up / down
# See https://registry.hub.docker.com/u/jwilder/nginx-proxy/
# This one uses a template for nginx proxying (see above for http)
#
# Note: Currently this is experimental and not being used.
#
dockergen:
  image: jwilder/docker-gen
  hostname: docker-gen
  volumes_from:
    - nginx
  volumes:
    - /var/run/docker.sock:/tmp/docker.sock
    - ./nginx-templates:/etc/docker-gen/templates
  # see https://github.com/jwilder/docker-gen/blob/master/README.md#usage
  command: -notify-sighup deployment_nginx_1 -watch -only-exposed /etc/docker-gen/templates/nginx-uwsgi.tmpl /etc/nginx/conf.d/uwsgi-proxies.conf

smtp:
  image: catatnight/postfix
  hostname: postfix
  environment:
    # You could change this to something more suitable
    - maildomain=kartoza.com
    - smtp_user=noreply:docker

db:
  image: kartoza/postgis
  volumes:
    - ./pg/postgres_data:/var/tasks/postgresql
  environment:
    - USERNAME=docker
    - PASS=<PASSWORD>

qgisserver:
  image: kartoza/qgis-server
  hostname: qgis-server
  volumes:
    - ../maps:/web
    - ./logs/qgisserver:/var/log/apache2
  links:
    - db:db

mapproxy:
  image: kartoza/mapproxy
  hostname: mapproxy
  volumes:
    - ../mapproxy:/mapproxy
  volumes_from:
    - qgisserver
  links:
    - qgisserver:qgisserver

rabbitmq:
  image: library/rabbitmq
  hostname: rabbitmq
  environment:
     - RABBIT_PASSWORD=<PASSWORD>
     - USER=rabbit_user
     - RABBITMQ_NODENAME=rabbit

uwsgi:
  build: docker-prod
  hostname: uwsgi
  environment:
    - DATABASE_NAME=gis
    - DATABASE_USERNAME=docker
    - DATABASE_PASSWORD=<PASSWORD>
    - DATABASE_HOST=db
    - RABBITMQ_HOST=rabbitmq
    - DJANGO_SETTINGS_MODULE=core.settings.prod_docker
    - VIRTUAL_HOST=watchkeeper.kartoza.org
    - VIRTUAL_PORT=8080
  volumes:
    - ../django_project:/home/web/django_project
    - ./static:/home/web/static
    - ./media:/home/web/media
    - ./reports:/home/web/reports
    - ./logs:/var/log/
  links:
    - smtp:smtp
    - db:db
    - rabbitmq:rabbitmq

worker:
  build: docker-prod
  hostname: worker
  command: celery worker -A event_mapper.celeryconf -l info
  environment:
    - DATABASE_NAME=gis
    - DATABASE_USERNAME=docker
    - DATABASE_PASSWORD=<PASSWORD>
    - DATABASE_HOST=db
    - RABBITMQ_HOST=rabbitmq
    - DJANGO_SETTINGS_MODULE=core.settings.prod_docker
    - VIRTUAL_HOST=watchkeeper.kartoza.org
    - VIRTUAL_PORT=8080
  volumes:
    - ../django_project:/home/web/django_project
    - ./static:/home/web/static
    - ./media:/home/web/media
    - ./reports:/home/web/reports
    - ./logs:/var/log/
  links:
    - smtp:smtp
    - db:db
    - rabbitmq:rabbitmq

#cron:
#  build: docker-cron
#  hostname: cron
#  environment:
#    - PGPASSWORD=<PASSWORD>
#    - PGUSER=docker
#    - PGPORT=5432
#    - PGHOST=db
#    - PGDATABASE=gis
#  volumes:
#    - ../maps:/home/web/maps
#    - ./reports:/home/web/reports
#    - ./cron-scripts:/home/web/cron-scripts
#    - /tmp/.X11-unix:/tmp/.X11-unix
#  links:
#    - db:db

web:
  image: nginx
  hostname: nginx
  volumes:
    - ./sites-enabled:/etc/nginx/conf.d:ro
    # I dont use volumes_from as I want to use the ro modifier
    - ./static:/home/web/static:ro
    - ./media:/home/web/media:ro
    - ./logs:/var/log/nginx
{'fraction_non_alphanumeric': 0.12279520667833581, 'fraction_numerical': 0.0070014810825366905, 'mean_word_length': 2.7364185110663986, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7194469', 'n_tokens_mistral': 3001, 'n_tokens_neox': 2812, 'n_words': 506}