services:
  db:
    image: mysql
    restart: always
    volumes:
      - type: bind
        source: data
        target: /docker-entrypoint-initdb.d
    networks:
      - backend
    environment:
      MYSQL_ROOT_PASSWORD: blupp
      MYSQL_DATABASE: blih
      MYSQL_USER: blah
      MYSQL_PASSWORD: blupp
    
  cms:
    image: frank
    restart: always
    build: .
    depends_on:
      db:
        condition: service_started
    volumes:
      - type: bind
        source: data
        target: /var/www/localhost/htdocs
    networks:
      - backend
    ports:
      - name: web
        target: 80
        published: 8000
        protocol: tcp
        app_protocol: http

networks:
  backend:
