Last active
June 18, 2019 01:14
-
-
Save diegobarros0701/e9848486e43b47a50527e21e1ba7636d to your computer and use it in GitHub Desktop.
docker-compose and Dockerfile for RoR environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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