Add an env var for PORT on render
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -17,6 +17,8 @@ services:
|
||||
numInstances: 1
|
||||
healthCheckPath: /up
|
||||
envVars:
|
||||
- key: PORT
|
||||
value: 3000
|
||||
- key: DATABASE_URL
|
||||
fromDatabase:
|
||||
name: mysite
|
||||
|
||||
Reference in New Issue
Block a user