volumes:
  yeswiki-db:
    name: yeswiki-db
  yeswiki:
    name: yeswiki

networks:
  yeswiki:

services:
  yeswiki-app:
    build:
      context: ..
      dockerfile: ./docker/dockerfile-prod
    container_name: yeswiki
    volumes:
      - ..:/var/www/html
    depends_on:
      - yeswiki-db
    env_file: ./yeswiki.secrets
    networks:
      - yeswiki

  yeswiki-db:
    image: mysql:latest
    container_name: yeswiki-db
    volumes:
      - yeswiki-db:/var/lib/mysql
    env_file: ./yeswiki.secrets
    networks:
      - yeswiki

  yeswiki-web:
    image: nginx:alpine
    container_name: yeswiki-web
    volumes:
      - ..:/var/www/html:ro
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - "8085:80"
    networks:
      - yeswiki
