Last active
March 19, 2019 09:01
-
-
Save TakuyaHarayama/392b932cb9f90bd5c2539fc46a8815d5 to your computer and use it in GitHub Desktop.
Simple docker for rails
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' | |
services: | |
db: | |
image: postgres | |
volumes: | |
- datavol:/var/lib/postgresql/data | |
web: | |
build: . | |
command: bundle exec rails s -p 3000 -b '0.0.0.0' | |
volumes: | |
- .:/app_name | |
ports: | |
- "3000:3000" | |
depends_on: | |
- db | |
stdin_open: true | |
tty: true | |
volumes: | |
datavol: |
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.5.0 | |
ENV LANG C.UTF-8 | |
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs | |
RUN mkdir /app_name | |
WORKDIR /app_name | |
ADD Gemfile /app_name/Gemfile | |
ADD Gemfile.lock /app_name/Gemfile.lock | |
RUN bundle install | |
COPY . /app_name |
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
source 'https://rubygems.org' | |
gem 'rails' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment