From 824d83411d9fb98543079fb6f025e61cc66129ff Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Wed, 5 Sep 2018 22:47:39 +0200 Subject: [PATCH] Drop the alpine based docker-compose environment --- .gitignore | 2 +- docker-compose.env.example | 40 ---------------------------- docker-compose.yml.example | 29 -------------------- docker/init.sh | 54 -------------------------------------- 4 files changed, 1 insertion(+), 124 deletions(-) delete mode 100644 docker-compose.env.example delete mode 100644 docker-compose.yml.example delete mode 100644 docker/init.sh diff --git a/.gitignore b/.gitignore index e49dd684..b4cba438 100644 --- a/.gitignore +++ b/.gitignore @@ -35,8 +35,8 @@ pickle-email-*.html .env.development .env.test .env.local -docker-compose.env docker-compose.yml +docker-compose.override.yml .DS_Store .byebug_history .buildconfig diff --git a/docker-compose.env.example b/docker-compose.env.example deleted file mode 100644 index c5a2b228..00000000 --- a/docker-compose.env.example +++ /dev/null @@ -1,40 +0,0 @@ -## database related variables ## - -# variables prefixed with MYSQL_ are used by both database and web containers -# variables prefixed with DATABASE_ are used exlusively by the web container - -MYSQL_DATABASE=osem -MYSQL_USER=osem -MYSQL_PASSWORD=changemeimmediately -MYSQL_ROOT_PASSWORD=changemeevenmoreimmediately - -# the following settings should not be modified unless the database service -# is renamed in docker-compose.yml or you plan to use an external database -DATABASE_HOST=database -DATABASE_PORT=3306 - - -## OSEM options ## -# you can configure any option described in this document here instead of -# having to create a .env file: -# https://github.com/openSUSE/osem/blob/master/dotenv.example - -OSEM_NAME="Dockerized OSEM" -OSEM_HOSTNAME="http://localhost:9292" -OSEM_ERRBIT_HOST="localhost" -SECRET_KEY_BASE="changemechangemechangeme" - -# these settings work for the MailHog server that is enabled by default in -# docker-compose.yml -# if you do not plan to use MailHog (you most likely don't want to), you need -# to change these settings to use an external working mailserver, otherwise -# your users are going to see the HTTP status 500 page -# you should comment out or remove the mailhog service from docker-compose.yml, -# too -OSEM_EMAIL_ADDRESS="osem@mailhog" -OSEM_SMTP_AUTHENTICATION="login" -OSEM_SMTP_ADDRESS="mailhog" -OSEM_SMTP_PORT=1025 -OSEM_SMTP_USERNAME="mailhog" -OSEM_SMTP_PASSWORD="mailhog" - diff --git a/docker-compose.yml.example b/docker-compose.yml.example deleted file mode 100644 index 0959523c..00000000 --- a/docker-compose.yml.example +++ /dev/null @@ -1,29 +0,0 @@ -version: "2" - -services: - database: - image: mariadb:10.1 - env_file: docker-compose.env - volumes: - - database:/var/lib/mysql - - mailhog: - image: mailhog/mailhog:latest - ports: - - "127.0.0.1:8025:8025" - - web: - build: . - env_file: docker-compose.env - depends_on: - - database - - mailhog - ports: - - "127.0.0.1:9292:9292" - volumes: - - "web:/data" - -# these named volumes are used to persist data -volumes: - database: - web: diff --git a/docker/init.sh b/docker/init.sh deleted file mode 100644 index 6a29044f..00000000 --- a/docker/init.sh +++ /dev/null @@ -1,54 +0,0 @@ -#! /bin/bash - -set -e - -# data directory is required for caching the secret key in a file -if [ "$DATA_DIR" == "" ]; then - echo -n "Error: DATA_DIR environment variable not set!" - echo "Are you sure you are running this script in a Docker container?" - exit 1 -fi - -SECRET_KEY_FILE="$DATA_DIR/secret_key" - -if [ ! -f "$SECRET_KEY_FILE" ]; then - echo ">>> Creating a new secret key file..." - install -m 0600 /dev/null "$SECRET_KEY_FILE" - SECRET_KEY=$(bundle exec rake secret) - echo "$key" > "$SECRET_KEY_FILE" - chmod -w "$SECRET_KEY_FILE" -else - SECRET_KEY=$(cat "$SECRET_KEY_FILE") -fi - -export SECRET_KEY -export RAILS_ENV=production - -install -m 0600 /dev/null .my.cnf -cat > .my.cnf <>> Waiting for database to get ready to connect..." -dockerize -wait tcp://$DATABASE_HOST:$DATABASE_PORT -timeout 60s true - -if [ $(echo "show tables;" | mysql --host $DATABASE_HOST --port $DATABASE_PORT $MYSQL_DATABASE | wc -l) -le 1 ]; then - echo ">>> Initializing database..." - bundle exec rake db:schema:load - - echo ">>> Seed database..." - bundle exec rake db:seed -fi - -echo ">>> Upgrading database..." -bundle exec rake db:migrate - -rm .my.cnf - -echo ">>> Precompiling assets..." -bundle exec rake assets:precompile - -echo ">>> Starting application server..." -exec bundle exec rails server -e production -b 0.0.0.0 -p 9292