diff options
| author | Florent Peyraud | 2018-01-02 19:24:18 +0100 |
|---|---|---|
| committer | Florent Peyraud | 2018-01-02 19:24:18 +0100 |
| commit | 5359817b6d11c57b005e11d2e89c507d6fc9ea5e (patch) | |
| tree | 0a8df6d39206125a418dd657c7ca4575693db2fe /Dockerfile | |
| parent | 9d9f3bea75b3581b1d602047e0a0cf69a15dc4bd (diff) | |
| download | chouette-core-5359817b6d11c57b005e11d2e89c507d6fc9ea5e.tar.bz2 | |
Dockerfile and compose-file
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8259981f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM debian:stable-slim + +ENV RAILS_ENV=production RAILS_SERVE_STATIC_FILES=true RAILS_LOG_TO_STDOUT=true + +RUN apt-get update && \ + apt-get install -y --no-install-recommends ruby2.3 && \ + apt-get install -y --no-install-recommends libpq5 libxml2 zlib1g imagemagick libproj12 && \ + apt-get install -y --no-install-recommends cron && \ + apt-get clean && rm -rf /var/lib/apt/lists/* && \ + gem2.3 install bundler + + +COPY stif-boiv-release.tar.gz / +RUN mkdir /app && apt-get update &&\ + apt-get -y install --no-install-recommends build-essential ruby2.3-dev libpq-dev libxml2-dev zlib1g-dev libproj-dev&& \ + tar -C /app -zxf stif-boiv-release.tar.gz && \ + cd /app && bundle install --local && \ + apt-get -y remove build-essential ruby2.3-dev libpq-dev libxml2-dev zlib1g-dev && \ + apt-get clean && apt-get -y autoremove && rm -rf /var/lib/apt/lists/* && \ + cd /app && rm config/database.yml && mv config/database.yml.docker config/database.yml && \ + cd /app && rm config/secrets.yml && mv config/secrets.yml.docker config/secrets.yml && \ + mv script/launch-cron /app && \ + bundle exec whenever --output '/proc/1/fd/1' --update-crontab stif-boiv --set 'environment=production&bundle_command=bundle exec' --roles=app,db,web + +WORKDIR /app +VOLUME /app/public/uploads + +EXPOSE 3000 + +CMD ["sh", "-c", "bundle exec rake db:migrate && bundle exec rails server -b 0.0.0.0"] |
