mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Improve docker support
- Add docker-compose file - Add environment variable to initialize the database - Add custom entrypoint that generates the .env file based on the environment variables - Update Dockerfile (gettext-base package)
This commit is contained in:
parent
3914796e4e
commit
0cbed2d5d2
55
.env.docker
Normal file
55
.env.docker
Normal file
@ -0,0 +1,55 @@
|
||||
APP_ENV=${FF_APP_ENV}
|
||||
APP_DEBUG=false
|
||||
APP_FORCE_SSL=false
|
||||
APP_FORCE_ROOT=
|
||||
APP_KEY=${FF_APP_KEY}
|
||||
APP_LOG=daily
|
||||
APP_LOG_LEVEL=warning
|
||||
APP_URL=http://localhost
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=${FF_DB_HOST}
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=${FF_DB_NAME}
|
||||
DB_USERNAME=${FF_DB_USER}
|
||||
DB_PASSWORD=${FF_DB_PASSWORD}
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
SESSION_DRIVER=file
|
||||
QUEUE_DRIVER=sync
|
||||
|
||||
COOKIE_PATH="/"
|
||||
COOKIE_DOMAIN=
|
||||
COOKIE_SECURE=false
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=mailtrap.io
|
||||
MAIL_PORT=2525
|
||||
MAIL_FROM=changeme@example.com
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
|
||||
SEND_REGISTRATION_MAIL=true
|
||||
SEND_ERROR_MESSAGE=true
|
||||
SHOW_INCOMPLETE_TRANSLATIONS=false
|
||||
|
||||
CACHE_PREFIX=firefly
|
||||
|
||||
GOOGLE_MAPS_API_KEY=
|
||||
ANALYTICS_ID=
|
||||
SITE_OWNER=mail@example.com
|
||||
USE_ENCRYPTION=true
|
||||
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_APP_ID=
|
||||
|
||||
DEMO_USERNAME=
|
||||
DEMO_PASSWORD=
|
||||
|
@ -12,6 +12,7 @@ RUN apt-get update -y && \
|
||||
libxml2-dev \
|
||||
libsqlite3-dev \
|
||||
libbz2-dev \
|
||||
gettext-base \
|
||||
locales && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
@ -44,3 +45,5 @@ WORKDIR /var/www/firefly-iii
|
||||
RUN composer install --no-scripts --no-dev
|
||||
|
||||
USER root
|
||||
|
||||
ENTRYPOINT ["/var/www/firefly-iii/docker/entrypoint.sh"]
|
||||
|
33
docker-compose.yml
Normal file
33
docker-compose.yml
Normal file
@ -0,0 +1,33 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
firefly-db:
|
||||
image: mysql:8
|
||||
environment:
|
||||
- MYSQL_DATABASE=firefly_db
|
||||
- MYSQL_USER=firefly_db
|
||||
- MYSQL_PASSWORD=firefly_db_secret
|
||||
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||
volumes:
|
||||
- firefly-storage:/var/lib/mysql
|
||||
|
||||
firefly-app:
|
||||
image: firefly-iii
|
||||
build:
|
||||
context: .
|
||||
environment:
|
||||
- INIT_DATABASE=yes
|
||||
- FF_DB_HOST=firefly-db
|
||||
- FF_DB_NAME=firefly_db
|
||||
- FF_DB_USER=firefly_db
|
||||
- FF_DB_PASSWORD=firefly_db_secret
|
||||
- FF_APP_KEY=SomeRandomStringOf32CharsExactly
|
||||
- FF_APP_ENV=development
|
||||
ports:
|
||||
- "80:80"
|
||||
links:
|
||||
- firefly-db
|
||||
|
||||
volumes:
|
||||
firefly-storage:
|
||||
driver: local
|
16
docker/entrypoint.sh
Executable file
16
docker/entrypoint.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat .env.docker | envsubst > .env
|
||||
|
||||
if [ "${INIT_DATABASE:="no"}" = "yes" ]; then
|
||||
echo "Init database detected, checking mysql status"
|
||||
# depends on your machine, but it may take a file to boot mysql container the first time
|
||||
until php artisan firefly:verify &>/dev/null
|
||||
do
|
||||
echo "waiting mysql"
|
||||
sleep 10
|
||||
done
|
||||
php artisan migrate:refresh --seed
|
||||
fi
|
||||
|
||||
exec apache2-foreground
|
Loading…
Reference in New Issue
Block a user