docker-compose.yaml 1012 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: mariadb:10-focal
  15. command: '--default-authentication-plugin=mysql_native_password'
  16. restart: always
  17. healthcheck:
  18. test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
  19. interval: 3s
  20. retries: 5
  21. start_period: 30s
  22. secrets:
  23. - db-password
  24. volumes:
  25. - db-data:/var/lib/mysql
  26. environment:
  27. - MYSQL_DATABASE=example
  28. - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
  29. expose:
  30. - 3306
  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