services:
  server:
    build:
      context: .
      dockerfile: docker/server/Dockerfile
    container_name: symfony-app
    volumes:
      - .:/var/www/html:rw,cached # Mountowanie kodu do katalogu kontenera
      - ~/.ssh:/root/.ssh:ro  # Montowanie kluczy SSH z hosta
    ports:
      - "8000:80"
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/html/public
    networks:
      - symfony_network
    extra_hosts:
      - "host.docker.internal:host-gateway"
    tty: true  # Potrzebne, aby sesje działały poprawnie
    stdin_open: true
    entrypoint: ["/bin/bash", "-c", "ssh -f -N -L 8543:pgsql1.small.pl:5432 adamus1234@s1.small.pl & apache2-foreground"]

networks:
  symfony_network:
    driver: bridge