docker-compose.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. version: '3'
  2. services:
  3. nginx:
  4. container_name: vtn-nginx
  5. ports:
  6. - 44443:443
  7. image: nginx:latest
  8. volumes:
  9. - "./nginx.conf:/etc/nginx/conf.d/default.conf"
  10. - "./ssl.crt:/etc/ssl/ssl.crt"
  11. - "./ssl.key:/etc/ssl/ssl.key"
  12. depends_on:
  13. - rails
  14. restart: unless-stopped
  15. db:
  16. container_name: vtn-db
  17. image: postgres:9.5
  18. volumes:
  19. - postgres_data:/var/lib/postgresql/data
  20. environment:
  21. POSTGRES_DB: ${RAILS_DB_DATABASE}
  22. POSTGRES_USER: ${RAILS_DB_USERNAME}
  23. POSTGRES_PASSWORD: ${RAILS_DB_PASSWORD}
  24. restart: unless-stopped
  25. rails:
  26. container_name: vtn-rails
  27. build: .
  28. expose:
  29. - 9292
  30. depends_on:
  31. - db
  32. restart: on-failure
  33. # command: initdb
  34. environment:
  35. - RAILS_ENV=${RAILS_ENV}
  36. - RAILS_SECRET_TOKEN=${RAILS_SECRET_TOKEN}
  37. - RAILS_DB_USERNAME=${RAILS_DB_USERNAME}
  38. - RAILS_DB_PASSWORD=${RAILS_DB_PASSWORD}
  39. - RAILS_DB_DATABASE=${RAILS_DB_DATABASE}
  40. - RAILS_DB_HOSTNAME=vtn-db
  41. volumes:
  42. postgres_data: