Skip to content

Instantly share code, notes, and snippets.

@mpan-wework
Created March 10, 2019 07:29
Show Gist options
  • Save mpan-wework/55a2de5cb15e846f9607e4dd43e782cb to your computer and use it in GitHub Desktop.
Save mpan-wework/55a2de5cb15e846f9607e4dd43e782cb to your computer and use it in GitHub Desktop.
redis-pg-redis-docker
default: &default
adapter: postgresql
encoding: unicode
database: <%= Rails.application.credentials[:pg_database] %>
username: <%= Rails.application.credentials[:pg_username] %>
password: <%= Rails.application.credentials[:pg_password] %>
host: <%= Rails.application.credentials[:pg_host] %>
port: <%= Rails.application.credentials[:pg_port] %>
pool: 5
development:
<<: *default
database: my_dev
username: pguser
password: p@55w0rdpg
host: localhost
port: 55432
test:
<<: *default
database: my_test
username: pguser
password: p@55w0rdpg
host: localhost
port: 55432
staging:
<<: *default
production:
<<: *default
version: '3'
services:
pg:
image: postgres:11.2-alpine
ports:
- '55432:5432'
volumes:
- ${HOME}/.docker-volumes/pg-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=p@55w0rdpg
- POSTGRES_USER=pguser
redis:
image: redis:5.0.3-alpine
ports:
- '56379:6379'
volumes:
- ${HOME}/.docker-volumes/redis-data:/data

Config Rails to use Postgres and Redis in docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment