docker-cmpose.yml 865 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. version: "3.9"
  2. services:
  3. postgres:
  4. image: postgres
  5. container_name: postgres
  6. volums:
  7. - ~/.pg/pg_data/flask-yt:/var/lib/postgresql/data
  8. env_file:
  9. - .env
  10. ports:
  11. - "54321:5432"
  12. flask:
  13. build:
  14. dockerfile: Dockerfile
  15. context: .
  16. container_name: flask
  17. volums:
  18. - ~/.uploads/images/flask-yt:/app/app/static/upload
  19. env_file:
  20. - .env
  21. environment:
  22. - POSTGRES_HOST=${POSTGRES_HOST}
  23. - POSTGRES_PORT=${POSTGRES_PORT}
  24. - POSTGRES_USER=${POSTGRES_USER}
  25. - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
  26. - POSTGRES_DB=${POSTGRES_DB}
  27. depends_on:
  28. - postgres
  29. expose:
  30. - 8080
  31. ngnix:
  32. build:
  33. dockerfile: ./Dockerfile
  34. context: ./ngnix/
  35. container_name: ngnix
  36. env_file:
  37. - .env
  38. depends_on:
  39. - flask
  40. ports:
  41. - "8080:80"