Merge branch 'docker' into 'rails5'
Add Docker development setup See merge request nilsding/retrospring!71
This commit is contained in:
commit
aaf682097e
|
@ -0,0 +1,30 @@
|
|||
FROM ruby:2.6
|
||||
|
||||
RUN apt-get update -qq && apt-get install -y build-essential
|
||||
|
||||
# for postgres
|
||||
RUN apt-get install -y libpq-dev
|
||||
|
||||
# for nokogiri
|
||||
RUN apt-get install -y libxml2-dev libxslt1-dev
|
||||
|
||||
# for images
|
||||
RUN apt-get install -y libmagickwand-dev imagemagick
|
||||
|
||||
# for a JS runtime
|
||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
|
||||
RUN apt-get install -y nodejs
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
postgresql-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV APP_HOME /app
|
||||
RUN mkdir $APP_HOME
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
ADD Gemfile* $APP_HOME/
|
||||
RUN bundle install
|
||||
|
||||
EXPOSE 3000
|
|
@ -0,0 +1,29 @@
|
|||
version: "3.7"
|
||||
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: .docker/ruby/Dockerfile
|
||||
command:
|
||||
ruby bin/rails server --port 3000 --binding 0.0.0.0
|
||||
links:
|
||||
- postgres
|
||||
- redis
|
||||
volumes:
|
||||
- ./:/app
|
||||
ports:
|
||||
- 3000:3000
|
||||
|
||||
redis:
|
||||
image: redis:3.2.11-alpine
|
||||
ports:
|
||||
- 6379:6379
|
||||
|
||||
postgres:
|
||||
image: postgres:10.12
|
||||
ports:
|
||||
- 5432:5432
|
||||
environment:
|
||||
POSTGRES_PASSWORD: justask
|
||||
POSTGRES_DB: justask_development
|
Loading…
Reference in New Issue