Skip to content

Commit

Permalink
add example for using init_winter and cms_admin_password environment …
Browse files Browse the repository at this point in the history
…options
  • Loading branch information
mik-p committed Apr 22, 2021
1 parent 1a8dc47 commit 3022d2b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ env:
BRANCH=stable
- VARIANT=php7.4/fpm
BRANCH=stable
- VARIANT=php7.3/apache
BRANCH=stable
- VARIANT=php7.3/fpm
BRANCH=stable
- VARIANT=php7.2/apache
BRANCH=stable
- VARIANT=php7.2/fpm
Expand All @@ -19,6 +23,10 @@ env:
BRANCH=develop
- VARIANT=php7.4/fpm
BRANCH=develop
- VARIANT=php7.3/apache
BRANCH=develop
- VARIANT=php7.3/fpm
BRANCH=develop
- VARIANT=php7.2/apache
BRANCH=develop
- VARIANT=php7.2/fpm
Expand Down
6 changes: 3 additions & 3 deletions docker-wn-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ fi
if [ "${INIT_WINTER,,}" == "true" ]; then
echo 'Initializing Winter CMS...'
php artisan winter:up
# newer versions of winter generate random passwords for admin

# newer versions of winter generate random passwords for admin
# if the environment option for admin password is set then change it here
if [ ! -z "$CMS_ADMIN_PASSWORD" ]; then
echo 'Update Winter CMS admin password...'
echo 'Update Winter CMS admin password...'
php artisan winter:passwd admin $CMS_ADMIN_PASSWORD
fi
fi
Expand Down
32 changes: 32 additions & 0 deletions examples/init-winter/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# this example attempts to use the INIT_WINTER option correctly
# with an automate admin password update
version: '2.2'
services:
winter:
image: hiltonbanes/wintercms:php7.4-apache
ports:
- 8888:80
depends_on: # slows down the container start waiting on DB up
mariadb:
condition: service_healthy
environment:
- DB_TYPE=mysql
- DB_HOST=mariadb #DB_HOST should match the service name of the database container
- DB_DATABASE=wintercms
- DB_USERNAME=root
- DB_PASSWORD=root
# initial DB seeding through entry point
- INIT_WINTER=true
- CMS_ADMIN_PASSWORD=admin # probably use the docker environment system to make a secret

mariadb:
image: mariadb:10.4
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: "/usr/bin/mysql --user=root --password=root --execute \"SHOW DATABASES;\""
interval: 3s
timeout: 1s
retries: 5
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=wintercms

0 comments on commit 3022d2b

Please sign in to comment.