From 5c94a7c515f967c409c3c48773cc2ebf8237245f Mon Sep 17 00:00:00 2001 From: Jyri-Petteri Paloposki Date: Thu, 16 Jul 2020 20:18:00 +0300 Subject: [PATCH] Fix the Docker configuration to work better --- Dockerfile | 11 ++++++ README.md | 21 ++--------- config/database.docker.yml | 46 ++++++++++++++++++++++++ config/site.docker.yml | 72 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 19 deletions(-) create mode 100644 config/database.docker.yml create mode 100644 config/site.docker.yml diff --git a/Dockerfile b/Dockerfile index 3a129889..a03bda6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM ruby:2.6 +# throw errors if Gemfile has been modified since Gemfile.lock +RUN bundle config --global frozen 1 + WORKDIR /app RUN touch /etc/app-env @@ -11,5 +14,13 @@ RUN bundle install --jobs 4 RUN mkdir /app/log COPY . /app/ +COPY config/database.docker.yml /app/config/database.yml +COPY config/site.docker.yml /app/config/site.yml + +#COPY docker-entrypoint.sh / +#ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 3000 + +#CMD ["rails", "server", "-e", "production", "-b", "0.0.0.0"] +CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/README.md b/README.md index 1998c771..ea3f6183 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,10 @@ * Wiki (community contributed information): https://github.com/TracksApp/tracks/wiki * Mailing list: http://groups.google.com/group/TracksApp * IRC channel: #tracks on Freenode +* Gitter: https://gitter.im/TracksApp/tracks * Original developer: bsag (http://www.rousette.org.uk/) * Contributors: https://github.com/TracksApp/tracks/wiki/Contributors -* Version: 2.4.2 +* License: See COPYING [![Build Status](https://github.com/TracksApp/tracks/workflows/Continuous%20Integration/badge.svg)](https://github.com/TracksApp/tracks/actions) [![Code Climate](https://codeclimate.com/github/TracksApp/tracks/badges/gpa.svg)](https://codeclimate.com/github/TracksApp/tracks) @@ -37,21 +38,3 @@ sure that you take sensible precautions and back up all your data frequently, taking particular care when you are upgrading. Enjoy being productive! - --------------------------------------------------------------------------------- - -Copyright (C) 2004-2016 rousette.org.uk - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/config/database.docker.yml b/config/database.docker.yml new file mode 100644 index 00000000..790d8f77 --- /dev/null +++ b/config/database.docker.yml @@ -0,0 +1,46 @@ +#development: +# adapter: mysql2 +# database: tracks_dev +# # set this if you are storing utf8 in your mysql database to handle strings +# # like "Réné". Not needed for sqlite. For PostgreSQL use encoding: unicode +# # encoding: utf8 +# host: docker +# port: 3307 +# username: tracks_dev +# password: FqUKMWPz5mh8UPhypZvq + +#development: +# adapter: postgresql +# database: tracks_dev +# # set this if you are storing utf8 in your mysql database to handle strings +# # like "Réné". Not needed for sqlite. For PostgreSQL use encoding: unicode +# # encoding: utf8 +# host: docker +# port: 5432 +# username: tracks_dev +# password: password + +#development: +# adapter: sqlite3 +# database: db.sqlite + +#test: +# adapter: mysql2 +# database: tracks_test +# # set this if you are storing utf8 in your mysql database to handle strings +# # like "Réné". Not needed for sqlite. For PostgreSQL use encoding: unicode +# # encoding: utf8 +# host: docker +# port: 3307 +# username: tracks_tst +# password: 9rMNV4y6RVcqmJTo2QoR + +# Production config is disabled by default +# +development: + adapter: <%= ENV.fetch('DATABASE_TYPE') %> + database: <%= ENV.fetch('DATABASE_NAME') %> + host: <%= ENV.fetch('DATABASE_HOST') %> + port: <%= ENV.fetch('DATABASE_PORT') %> + username: <%= ENV.fetch('DATABASE_USERNAME') %> + password: <%= ENV.fetch('DATABASE_PASSWORD') %> diff --git a/config/site.docker.yml b/config/site.docker.yml new file mode 100644 index 00000000..02c8b373 --- /dev/null +++ b/config/site.docker.yml @@ -0,0 +1,72 @@ +# NOTE: openid, ldap and cas are currently not supported anymore. +authentication_schemes: + - "database" + +# You'll probably want to change this to the time zone of the computer where +# Tracks is running. Run rake time:zones:local have Rails suggest time zone +# names on your system +time_zone: "UTC" + +# setting this to true will make the cookies only available over HTTPS +secure_cookies: false + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# +# if you want a nice random key, run this from the tracks directory and +# copy-and-paste the result: +# +# rake secret +# +secret_token: "secret" + +# Set to true when your application is running with https +force_ssl: false + +# Configure how static assets (images, stylesheets, etc.) will be served. +# The best practice is to have a proxying web server such as Apache or Nginx +# serve static assets (images, stylesheets, javascript) for you. Change +# this to 'true' if you want Rails to be responsible for serving the static assets +# serve_static_assets: false + +# Uncomment if you want to dispatch todos that come from email based on the To: +# address rather than the From: address. +# email_dispatch: 'to' + +# If you want to send all email to a specific user, uncomment the following line +# and set the environment variable TRACKS_MAIL_RECEIVER to the login name of the +# user that will receive all email +# email_dispatch: 'single_user' + +# Set this to the subdirectory you're hosting tracks in and uncomment if +# applicable. NOTE: you will also need to set up your web server to deal with +# the relative URL. Mongrel, for example, has a --prefix option. +# subdir: "/tracks" + +# Set to true to allow anyone to sign up for a username. +open_signups: false + +# When integrating your tracks instance with http://cloudmailin.com/ by using +# the /integrations/cloudmailin URL, this value is the cloudmailin-secret for +# verifying the authenticity of the request. +# (see http://docs.cloudmailin.com/validating_the_sender) +# cloudmailin: asdasd + +# Mailgun api key - used to verify incoming HTTP requests from Mailgun.org +# mailgun_api_key: key-abcdef1234567890 + +# change this to reflect the email address of the admin that you want to show +# on the signup page +admin_email: my.email@domain.com + +# Map of allowed incoming email addresses to real users +# Requires email_dispatch == 'to' +# This allows you to specify _who_ can send email Todos to your list +# The format is your incoming email (as per preferences page) for the key, and +# an array-list of acceptable senders for that account +#mailmap: +# 'user@preferences.from.value': +# - 'acceptable1@personal.org' +# - 'acceptable2@work.com'