From 33ee7a06402c7b49ed0599815f7b3bef6c40a6c5 Mon Sep 17 00:00:00 2001 From: Ryan W Date: Sat, 30 Sep 2023 14:17:36 -0700 Subject: [PATCH] Add an env var for PORT on render --- README.md | 10 ++++++++++ production.Dockerfile | 1 - render.yaml | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8020d2f..ee4ba7a 100644 --- a/README.md +++ b/README.md @@ -78,11 +78,21 @@ docker compose up --build DOCKER_BUILDKIT=1 docker build --tag rails-on-docker --file production.Dockerfile . --load ``` +Test the image can be used and Rails starts up, use a fake key for testing purposes only: +``` +docker run --rm --env SECRET_KEY_BASE=dummy rails-on-docker +``` + ### With legacy builder (no BuildKit) ``` docker build --tag rails-on-docker --file production.Dockerfile . ``` +Test the image can be used and Rails starts up, use a fake key for testing purposes only: +``` +docker run --rm --env SECRET_KEY_BASE=dummy rails-on-docker +``` + ## Deployment This app can be hosted wherever Ruby is supported and PostgreSQL databases can be provisioned. diff --git a/production.Dockerfile b/production.Dockerfile index 7e6f56f..9a18842 100644 --- a/production.Dockerfile +++ b/production.Dockerfile @@ -83,6 +83,5 @@ HEALTHCHECK --interval=5s --timeout=3s --start-period=0s --start-interval=5s --r # Start the server by default, this can be overwritten at runtime EXPOSE 3000 -EXPOSE 10000 # CMD ["./bin/rails", "server"] CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"] diff --git a/render.yaml b/render.yaml index e32c5f3..529afb9 100644 --- a/render.yaml +++ b/render.yaml @@ -17,6 +17,8 @@ services: numInstances: 1 healthCheckPath: /up envVars: + - key: PORT + value: 3000 - key: DATABASE_URL fromDatabase: name: mysite