Skip to content

Instantly share code, notes, and snippets.

@diegobarros0701
Last active June 18, 2019 01:14
Show Gist options
  • Save diegobarros0701/e9848486e43b47a50527e21e1ba7636d to your computer and use it in GitHub Desktop.
Save diegobarros0701/e9848486e43b47a50527e21e1ba7636d to your computer and use it in GitHub Desktop.
docker-compose and Dockerfile for RoR environment
version: '3'
volumes:
mysql-data:
services:
db:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- "mysql-data:/var/lib/mysql"
environment:
MYSQL_ROOT_PASSWORD: root
web:
build: .
command: bash -c "bundle exec rails s -p 3000 -b 0.0.0.0"
volumes:
- .:/app
ports:
- "3000:3000"
links:
- db
depends_on:
- db
environment:
DB_USER: root
DB_NAME: site_sefin
DB_PASSWORD: root
DB_HOST: db
FROM ruby:2.6
RUN apt-get update -qq && apt-get install -y nodejs
RUN mkdir /app
WORKDIR /app
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock
RUN bundle install
COPY . /app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment