From 93f871f8d9f02f0a6356818d1fccbb57d7027407 Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sun, 29 Mar 2020 17:12:49 +0900 Subject: [PATCH] Add Dockerfile to make it easier to try Redmine with Docker --- .dockerignore | 9 +++++++++ Dockerfile | 27 +++++++++++++++++++++++++++ doc/INSTALL | 19 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..bea4b702d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.bundle +Gemfile.local +Gemfile.lock +config/configuration.yml +config/database.yml +db/*.sqlite3 +files +log +tmp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8b98525d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM ruby:2.6-slim + +WORKDIR /var/lib/redmine + +RUN set -eux; \ + apt-get update; \ + apt-get install -y -q --no-install-recommends build-essential libsqlite3-dev ghostscript imagemagick + +COPY . . + +RUN set -uex; \ + mkdir files logs tmp; \ + for env in development production test; do \ + echo "$env:" >> config/database.yml; \ + echo " adapter: sqlite3" >> config/database.yml; \ + echo " database: db/redmine_$env.sqlite3" >> config/database.yml; \ + echo >> config/database.yml; \ + done + +RUN set -uex; \ + bundle install; \ + bin/rails generate_secret_token + +EXPOSE 3000 +CMD set -uex; \ + bin/rails db:migrate redmine:plugins; \ + bin/rails server -b 0.0.0.0 diff --git a/doc/INSTALL b/doc/INSTALL index d363c8a2a..e60ef90c6 100644 --- a/doc/INSTALL +++ b/doc/INSTALL @@ -96,6 +96,25 @@ Do not forget to restart the application after any change to this file. Please do not enter your SMTP settings in environment.rb. +== Quickly launch Redmine trial environment with Docker + +You can use Docker to quickly set up a Redmine environment for a trial. + +1. Uncompress the program archive + +2. Build a Docker image by running: + docker build -t redmine_trial . + +3. Launch Redmine in a new Docker container by running: + docker run -it -p 3000:3000 -e RAILS_ENV=production redmine_trial + + Once Redmine has started, point your browser to http://localhost:3000/ + You should now see the application welcome page. + +4. Delete the container and image after have played with Redmine: + docker container rm CONTAINER_ID + docker image rm redmine_trial + == References * http://www.redmine.org/wiki/redmine/RedmineInstall -- 2.25.2