Skip to content

Instantly share code, notes, and snippets.

@goodwill
Last active December 29, 2017 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goodwill/b4e677ccf8fe0079183adeec35218812 to your computer and use it in GitHub Desktop.
Save goodwill/b4e677ccf8fe0079183adeec35218812 to your computer and use it in GitHub Desktop.
# We need compose because otherwise its very hard to hook IP between machines for service interop
version: '3.2'
services:
redis_db:
image: redis:3.2.11
expose:
- "6379"
web:
build:
context: ../..
dockerfile: ./docker/development/Dockerfile
# args:
# - GOTANDA_LINE_DIR
# Run interactively so we can use the bash shell
stdin_open: true
tty: true
env_file:
- ../../.env.development
environment:
- RACK_ENV=development
- RAILS_ENV=development
- REDISCLOUD_URL=redis://redis_db:6379
- REDIS_PROVIDER=REDISCLOUD_URL
- REDIS_URI=redis://redis_db:6379
- REDIS_URI_FOR_ML=redis://redis_db:6379/1
- REDIS_NAMESPACE=omnitech-api
- DB_HOST=docker.for.mac.localhost
- DOCKER=true
ports:
- "3000:3000"
- "8080:8080"
volumes:
- type: bind
source: ../../app
target: /app/app
- type: bind
source: ../../lib
target: /app/lib
- type: bind
source: ../../db
target: /app/db
- type: bind
source: ../../bin
target: /app/bin
- type: bind
source: ../../config
target: /app/config
- type: bind
source: ../../public
target: /app/public
- type: bind
source: ../../scripts
target: /app/scripts
- type: bind
source: ../../uploads
target: /app/uploads
depends_on:
- redis_db
FROM ruby:2.3.5
LABEL MAINTAINER william@tofugear.com
ARG GOTANDA_LINE_DIR
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-get update && apt-get install -y \
build-essential \
libssl-dev \
libreadline-dev \
zlib1g-dev \
htop \
dstat
RUN if ! which node; then curl -sL https://deb.nodesource.com/setup_6.x | bash - ; fi
RUN apt-get -y install \
imagemagick \
libmagickwand-dev \
libicu-dev \
libpq-dev \
nodejs \
libhiredis-dev \
python3-dev \
python3-pip \
python3-cffi \
libcairo2 \
libpango-1.0-0 \
libpangocairo-1.0.0 \
libgdk-pixbuf2.0-0 \
libffi-dev \
shared-mime-info
# Install postgresql client
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y postgresql-client-9.6
# END Install postgres client
# Install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn
# END Install yarn
ENV LC_ALL="en_US.UTF-8"
ENV LC_CTYPE="en_US.UTF-8"
RUN pip3 install --upgrade cffi
RUN pip3 install WeasyPrint
# Configure the main working directory. This is the base
# directory used in any further RUN, COPY, and ENTRYPOINT
# commands.
RUN mkdir -p /app
WORKDIR /app
COPY ./Gemfile Gemfile.lock ./
COPY ./gems_git_repos ./gems_git_repos
COPY ./vendor/gems ./vendor/gems
COPY ./package.json ./yarn.lock ./
# Start bundling
RUN bundle install --jobs 20 --retry 5
RUN yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment