Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ruby:2.4.0

ENV PATH=/code/bin:$PATH RAILS_ENV=development RACK_ENV=development LANG=C.UTF-8

RUN mkdir /code
ADD ./Gemfile* /code/
ADD . /code

WORKDIR /code

# Run dependencies install commands
RUN bundle install
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: "2"

---
volumes:
mysql-data:
driver: local
rails-data:
driver: local


---
services:
db:
image: mysql:5.7
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: mypassword
MYSQL_DATABASE: database_name
volumes:
- mysql-data:/var/lib/mysql
env_file:
- dev.env
web:
image: your_image_name_here:latest
build:
context: "."
dockerfile: dev.Dockerfile
command: rails server -b 0.0.0.0 -p 3000 -P /tmp/rails.pid
ports:
- 3000:3000
working_dir: "/usr/src/app"
volumes:
- ".:/usr/src/app"
- rails-data:/usr/local/bundle
stdin_open: true
tty: true
links:
- db
depends_on:
- db
env_file:
- dev.env