Skip to content

Instantly share code, notes, and snippets.

@lunks
Created May 15, 2021 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunks/369568b8bf699ccb8b7512ee7dd2bb8e to your computer and use it in GitHub Desktop.
Save lunks/369568b8bf699ccb8b7512ee7dd2bb8e to your computer and use it in GitHub Desktop.
Docker config
version: "3.6"
volumes:
bundle:
postgres:
node_modules:
services:
web:
build:
context: .
dockerfile: Dockerfile-dev
image: web
command: bundle exec puma -C config/puma.rb
env_file: .env
environment:
- REDIS_URL=redis://redis:6379/0
- DEV_MAILER_DELIVERY_METHOD=smtp
- SMTP_HOST=mailcatcher
- PGHOST=postgres
- PGUSER=admin
- PGPASSWORD=admin
- RAILS_LOG_STDOUT=1
- WEBPACKER_DEV_SERVER_HOST=webpacker
volumes:
- .:/app
- bundle:/usr/local/bundle
- node_modules:/app/node_modules
ports:
- 3000:3000
depends_on:
- postgres
- redis
webpacker:
image: web
command: ./bin/webpack-dev-server
volumes:
- .:/app
- bundle:/usr/local/bundle
- node_modules:/app/node_modules
ports:
- "3035:3035"
env_file:
- .env
environment:
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0
worker:
image: web
command: bundle exec sidekiq -q high -q default -q low
env_file: .env
environment:
- REDIS_URL=redis://redis:6379/0
- DEV_MAILER_DELIVERY_METHOD=smtp
- SMTP_HOST=mailcatcher
- PGHOST=postgres
- PGUSER=admin
- PGPASSWORD=admin
- RAILS_LOG_STDOUT=1
- RAILS_MAX_THREADS=50
volumes:
- .:/app
- bundle:/usr/local/bundle
depends_on:
- postgres
- redis
shoryuken:
image: web
command: bundle exec shoryuken -R -C config/shoryuken.yml -r ./app/workers
env_file: .env
environment:
- REDIS_URL=redis://redis:6379/0
- DEV_MAILER_DELIVERY_METHOD=smtp
- SMTP_HOST=mailcatcher
- PGHOST=postgres
- PGUSER=admin
- PGPASSWORD=admin
- RAILS_LOG_STDOUT=1
- RAILS_MAX_THREADS=1
volumes:
- .:/app
- bundle:/usr/local/bundle
depends_on:
- postgres
- redis
postgres:
image: postgres:12.4
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
volumes:
- postgres:/var/lib/postgresql/data
- .:/app
redis:
image: redis:4
mailcatcher:
image: ruby
build:
context: .
dockerfile: Dockerfile-mailcatcher
ports:
- "1080:1080"
FROM ruby:2.7.1
# Install Node.js
RUN curl --silent --location https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install --yes nodejs
RUN apt-get install --yes libsodium23
RUN apt-get install --yes build-essential
RUN npm install -g yarn
WORKDIR /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment