docker-compose.yml 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. version: "3.9"
  2. services:
  3. app:
  4. build:
  5. context: ./
  6. dockerfile: development.dockerfile
  7. ports:
  8. - 80:8080
  9. volumes:
  10. - ./:/app
  11. labels:
  12. - traefik.http.routers.app.rule=PathPrefix(`/app`)
  13. - traefik.http.services.app.loadbalancer.server.port=8080
  14. - traefik.http.middlewares.app-prefix.stripprefix.prefixes=/app
  15. - traefik.http.middlewares.app-prefix.stripprefix.forceSlash=false # see https://doc.traefik.io/traefik/middlewares/stripprefix/#forceslash
  16. - traefik.http.routers.app.middlewares=app-prefix
  17. # setup a proxy to test hosting on a sub-path; here localhost:8080/app
  18. proxy:
  19. image: traefik:v2.3
  20. command:
  21. - --providers.docker
  22. - --api.insecure=true
  23. - --accesslog # http access log
  24. - --log #Traefik log, for configurations and errors
  25. - --api # Enable the Dashboard and API
  26. ports:
  27. - "8888:80"
  28. volumes:
  29. # Traefik must be able to listen for Docker events
  30. - /var/run/docker.sock:/var/run/docker.sock