Created
October 9, 2017 15:59
-
-
Save th0j/45a98ae2b8f32703f64916ac314a7de6 to your computer and use it in GitHub Desktop.
Speedup 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
version: '2' | |
services: | |
db: | |
image: postgres:9.6.5-alpine | |
volumes: | |
- postgres-data:/var/lib/postgresql/data | |
backend: | |
build: . | |
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" | |
ports: | |
- "3000:3000" | |
depends_on: | |
- db | |
- redis | |
volumes: | |
- .:/app | |
- bundle:/bundle | |
environment: | |
- REDIS_URL=redis://redis:6379 | |
redis: | |
image: redis:4.0.2-alpine | |
ports: | |
- "6379:6379" | |
volumes: | |
- redis-data:/var/lib/redis | |
command: redis-server | |
volumes: | |
postgres-data: | |
driver: local | |
redis-data: | |
driver: local | |
bundle: | |
driver: local |
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: | |
db: | |
image: postgres:9.6.5-alpine | |
backend: | |
build: . | |
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'" | |
ports: | |
- "3000:3000" | |
depends_on: | |
- db | |
- redis | |
environment: | |
- REDIS_URL=redis://redis:6379 | |
redis: | |
image: redis:4.0.2-alpine | |
ports: | |
- "6379:6379" | |
command: redis-server |
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.4.1-alpine3.6 | |
RUN apk add --update build-base libffi-dev libxml2-dev libxslt-dev postgresql-dev nodejs tzdata bash | |
ENV RAILS_ENV=production \ | |
APP_HOME=/app \ | |
ENV BUNDLE_PATH /bundle | |
RUN mkdir -p $APP_HOME | |
WORKDIR $APP_HOME | |
RUN gem install bundler | |
COPY Gemfile* $APP_HOME/ | |
COPY . $APP_HOME | |
EXPOSE 3000 | |
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] |
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.4.1-alpine3.6 | |
RUN apk add --update build-base libffi-dev libxml2-dev libxslt-dev postgresql-dev nodejs tzdata bash | |
ENV RAILS_ENV=production \ | |
APP_HOME=/app \ | |
RUN mkdir -p $APP_HOME | |
WORKDIR $APP_HOME | |
COPY Gemfile* $APP_HOME/ | |
RUN gem install bundler | |
RUN bundle install | |
COPY . $APP_HOME | |
EXPOSE 3000 | |
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment