Merge pull request #2415 from TracksApp/docker-fix

Better Docker integration
This commit is contained in:
Jyri-Petteri Paloposki 2020-07-17 00:38:54 +03:00 committed by GitHub
commit 466a4821db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 129 additions and 0 deletions

View file

@ -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"]

View file

@ -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') %>

72
config/site.docker.yml Normal file
View file

@ -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'