-
-
Save TETRA2000/884e2f6ee3cfa63b3159d6e8d0a7d955 to your computer and use it in GitHub Desktop.
Ruby on Rails on Docker
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
.bundle | |
tmp | |
vendor/bundle |
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: '2' | |
services: | |
app: | |
build: . | |
expose: | |
- "3000" | |
ports: | |
- "3000:3000" | |
environment: | |
- RAILS_ENV=development | |
volumes: | |
- .:/opt/app | |
links: | |
- db | |
db: | |
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci | |
image: "mariadb:10.1.2" | |
expose: | |
- "3306" | |
environment: | |
- MYSQL_ROOT_PASSWORD=password |
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.3 | |
## Optional | |
# RUN apt-get update | |
# RUN apt-get install -y nodejs npm | |
ADD . /opt/app | |
WORKDIR /opt/app | |
RUN mkdir /home/app | |
RUN bundle install | |
RUN useradd app | |
RUN chown app /home/app | |
USER app | |
EXPOSE 3000 | |
ENTRYPOINT bundle exec rake db:create db:migrate db:seed | |
CMD rm /opt/app/tmp/pids/server.pid; bin/rails s -b 0.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment