From f60e6c63c141fe2f24f893f1aa4037ca3965cc14 Mon Sep 17 00:00:00 2001 From: fumimowdan Date: Thu, 14 Sep 2023 15:01:05 +0100 Subject: [PATCH] Add docker-compose.yml * added Tiltfile --- Tiltfile | 2 ++ bin/app-startup.sh | 2 ++ docker-compose.yml | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 Tiltfile create mode 100644 docker-compose.yml diff --git a/Tiltfile b/Tiltfile new file mode 100644 index 00000000..ac5920b3 --- /dev/null +++ b/Tiltfile @@ -0,0 +1,2 @@ +# point Tilt at the existing docker-compose configuration. +docker_compose("./docker-compose.yml") \ No newline at end of file diff --git a/bin/app-startup.sh b/bin/app-startup.sh index e28122a7..5c355d80 100755 --- a/bin/app-startup.sh +++ b/bin/app-startup.sh @@ -3,6 +3,8 @@ # Dockerfile application startup script # +set -e + # run migrations bundle exec rails db:migrate diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..89876bd4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,47 @@ +version: '3.9' +services: + + redis: + image: redis:6.0-alpine + networks: + - gtrp + ports: + - 6379:6379 + + postgres: + image: postgres:15-alpine + networks: + - gtrp + environment: + - POSTGRES_USER=gtrp + - POSTGRES_PASSWORD=gtrp + - POSTGRES_DB=get_an_international_relocation_payment_development + ports: + - 5432:5432 + + app: &app + build: + context: . + args: + - COMMIT_SHA=shafoo + - GOVUK_NOTIFY_API_KEY + - GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID + networks: + - gtrp + depends_on: [ postgres, redis ] + ports: + - 3000:3000 + environment: + - DATABASE_URL=postgresql://gtrp:gtrp@postgres/get_an_international_relocation_payment_development + - REDIS_URL=redis://redis + env_file: + - .env + + worker: + <<: *app + ports: + - 3001:3001 + command: bundle exec sidekiq -C ./config/sidekiq.yml + +networks: + gtrp: