version: '3.1'

services:
  db:
    image: postgres:alpine
    container_name: kassenzettel-postgres
    restart: always
    ports: 
      - 5432:5432
    volumes:
      - ./db:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: example
      POSTGRES_USER: postgres
      POSTGRES_DB: kassenzettel
      POSTGRES_INITDB_ARGS: "--encoding='UTF8'"
      
  redis:
    image: redis:alpine
    container_name: kassenzettel-redis
    restart: always 
    ports:
      - 6379:6379

  web:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: nginx
    restart: always
    ports:
      - 8080:8080
    volumes:
      - ./receipeServer/static/:/app/static
                  