mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Drop the alpine based docker-compose environment
This commit is contained in:
parent
2e91f8512a
commit
824d83411d
4 changed files with 1 additions and 124 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -35,8 +35,8 @@ pickle-email-*.html
|
||||||
.env.development
|
.env.development
|
||||||
.env.test
|
.env.test
|
||||||
.env.local
|
.env.local
|
||||||
docker-compose.env
|
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
docker-compose.override.yml
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.byebug_history
|
.byebug_history
|
||||||
.buildconfig
|
.buildconfig
|
||||||
|
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
||||||
|
|
@ -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:
|
|
||||||
|
|
@ -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 <<ABC
|
|
||||||
[client]
|
|
||||||
user=$MYSQL_USER
|
|
||||||
password=$MYSQL_PASSWORD
|
|
||||||
ABC
|
|
||||||
|
|
||||||
echo ">>> 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
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue