Skip to content

Commit

Permalink
πŸ§‘β€πŸ’» Add in docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
kadams54 committed May 25, 2024
1 parent 6a3f225 commit 68c2863
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
db:
image: postgres:15
ports:
- "5432:5432"
volumes:
- ./tmp/data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: password
web:
build: .
volumes:
- .:/rails
ports:
- "3000:3000"
depends_on:
- db
env_file: .env
environment:
PGHOST: db
6 changes: 6 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
default: &default
adapter: postgresql
encoding: unicode
username: <%= ENV.fetch("PGUSER") { "postgres" } %>
password: <%= ENV.fetch("PGPASSWORD") { "password" } %>
host: <%= ENV.fetch("PGHOST") { "localhost" } %>
port: <%= ENV.fetch("PGPORT") { 5432 } %>
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
timeout: 5000

Expand Down

0 comments on commit 68c2863

Please sign in to comment.