services: nginx: image: nginx:latest container_name: nginx_with_auth ports: - "50080:80" volumes: - ./secret-file.txt:/app/secret-file.txt:ro - ./nginx.conf:/etc/nginx/nginx.conf:ro - ./.htpasswd:/etc/nginx/.htpasswd:ro