Skip to content

Instantly share code, notes, and snippets.

@evelyne24
Last active September 4, 2019 19:57
Show Gist options
  • Save evelyne24/dc2a5ae271d26422c3d02783168a6e82 to your computer and use it in GitHub Desktop.
Save evelyne24/dc2a5ae271d26422c3d02783168a6e82 to your computer and use it in GitHub Desktop.
Docker-ize Connfa
Dockerfile
.git
.git*
APP_ENV=local
APP_DEBUG=true
APP_KEY=base64:vMG4swzYwNmeVbInCchcXSP/wwXxVXQRBW4tvBqqyZw=
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=mysql_server
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=array
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
API_PREFIX=api
API_DOMAIN=
API_VERSION=v2
API_DEBUG=true
API_CONDITIONAL_REQUEST=false

Connfa is an Open Source framework for conferences and events. Alongside mobile apps (Android and iOS) and a web app, it also offers a Content Management System and an integration server, written in PHP (Laravel).

This aims to wrap Connfa CMS and Integration Server into a Docker image, publicly available in Docker Hub to make it easier to get the server up and running and seed the database with test data, to be able to quicly asses the suitability of the framework.

version: '3'
services:
connfa:
image: inrya/connfa
ports:
- "8080:80"
volumes:
- /tmp/apache-logs/:/var/log/apache2
links:
- mysql_server
env_file:
- ".env"
mysql_server:
image: mysql:latest
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=homestead
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
- MYSQL_RANDOM_ROOT_PASSWORD=true
migrator:
image: inrya/connfa-seed
links:
- mysql_server
env_file:
- ".env"
FROM eboraas/laravel:latest
RUN apt-get update && apt-get install -y php5-curl
WORKDIR /var/www/laravel/
COPY app ./app
COPY vendor ./vendor
COPY public ./public
COPY config ./config
COPY Parser ./Parser
COPY resources ./resources
RUN chmod a+rw /var/www/laravel/
#!/bin/sh
#set -o xtrace
echo "Waiting for database to come up"
retries=20
until mysql --host=$DB_HOST --user=$DB_USERNAME --password=$DB_PASSWORD $DB_DATABASE; do
echo "Mysql is unavailable - sleeping"
sleep 3
retries=$((retries-=1))
if [ "$retries" -lt 0 ]
then
echo "retried $retries times. giving up!"
exit 1
else
echo "retries=$retries"
fi
done
echo "Mysql is up - executing migrations"
php artisan migrate
php artisan db:seed
php artisan password:change --name=admin --password=$CMS_ADMIN_PASS
@beevelop
Copy link

beevelop commented Sep 4, 2019

Quick headsup: You should fix the mysql_server to 5.7. Seems that it does not work anymore properly with latest (= 8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment