From 75ba77786e6b8e480eac9eaa1b674ccb1908972a Mon Sep 17 00:00:00 2001 From: Boyan Tabakov Date: Tue, 27 Mar 2018 13:46:33 +0300 Subject: [PATCH] Add Docker support --- .dockerignore | 28 ++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++++ docker-compose.yml | 6 ++++++ 3 files changed, 56 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..8464fdc5836 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,28 @@ +.git +Dockerfile +.dockerignore + +*.gem +*.rbc +.bundle +.config +coverage +InstalledFiles +lib/bundler/man +pkg +rdoc +spec/reports +test/tmp +test/version_tmp +tmp +*.DS_STORE +build/ +.cache +.vagrant +.sass-cache + +# YARD artifacts +.yardoc +_yardoc +doc/ +.idea/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..b1d807badbe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ruby:2.3-alpine + +MAINTAINER Sharetribe Team + +RUN apk add --update nodejs g++ make + +# Add user for running the app +RUN adduser -D app + +COPY Gemfile Gemfile.lock /opt/app/ +WORKDIR /opt/app +USER app +RUN bundle install + +COPY . /opt/app +USER root +RUN chown -R app:app /opt/app +USER app + +EXPOSE 4567 + +CMD ["bundle", "exec", "middleman", "server", "--watcher-force-polling"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000..6742790cd30 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +app: + build: . + ports: + - 4567:4567 + volumes: + - ./source:/opt/app/source