docker-compose.yaml 917 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. services:
  2. backend:
  3. build:
  4. context: backend
  5. target: dev-envs
  6. volumes:
  7. - /var/run/docker.sock:/var/run/docker.sock
  8. secrets:
  9. - db-password
  10. depends_on:
  11. db:
  12. condition: service_healthy
  13. db:
  14. image: postgres
  15. restart: always
  16. user: postgres
  17. secrets:
  18. - db-password
  19. volumes:
  20. - db-data:/var/lib/postgresql/data
  21. environment:
  22. - POSTGRES_DB=example
  23. - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
  24. expose:
  25. - 5432
  26. healthcheck:
  27. test: [ "CMD", "pg_isready" ]
  28. interval: 10s
  29. timeout: 5s
  30. retries: 5
  31. proxy:
  32. image: nginx
  33. volumes:
  34. - type: bind
  35. source: ./proxy/nginx.conf
  36. target: /etc/nginx/conf.d/default.conf
  37. read_only: true
  38. ports:
  39. - 80:80
  40. depends_on:
  41. - backend
  42. volumes:
  43. db-data:
  44. secrets:
  45. db-password:
  46. file: db/password.txt