Page MenuHomeDevCentral

No OneTemporary

diff --git a/Dockerfile b/Dockerfile
index fb2df4b..14f2036 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,27 +1,27 @@
#
# Nasqueron - Cachet image
#
FROM nasqueron/nginx-php-fpm:novolume
MAINTAINER Sébastien Santoro aka Dereckson <dereckson+nasqueron-docker@espace-win.org>
#
# Prepare the container
#
-USER app
+COPY files /
+
WORKDIR /var/wwwroot/default
RUN git init && git remote add origin https://github.com/cachethq/Cachet.git && \
git fetch && git checkout -t origin/master && \
- wget https://raw.githubusercontent.com/nasqueron/docker-cachet/master/.env && \
composer install --no-dev -o && \
php artisan migrate && \
- php artisan key:generate && \
- php artisan config:cache
+ chown -R app:app /var/wwwroot/default
#
# Run the container
#
-USER root
+CMD ["/usr/local/sbin/init-container"]
+
diff --git a/files/usr/local/bin/setup-container b/files/usr/local/bin/setup-container
new file mode 100755
index 0000000..e8db796
--- /dev/null
+++ b/files/usr/local/bin/setup-container
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+pushd /var/wwwroot/default
+
+if [ -z "$NO_INSTALL" ]; then
+ php artisan key:generate
+ php artisan config:cache
+ chown app:app .env
+fi
+
+# We're done
+popd
+touch .initialized
diff --git a/files/usr/local/sbin/init-container b/files/usr/local/sbin/init-container
new file mode 100755
index 0000000..c35241d
--- /dev/null
+++ b/files/usr/local/sbin/init-container
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ ! -f .initialized ]; then
+ # Container is initialized according the environment variables
+ # passed to the container to setup the application.
+ /usr/local/bin/setup-container
+fi
+
+/usr/local/sbin/runsvdir-init
diff --git a/.env b/files/var/wwwroot/default/.env
similarity index 76%
rename from .env
rename to files/var/wwwroot/default/.env
index 4a8d573..1e12b6d 100644
--- a/.env
+++ b/files/var/wwwroot/default/.env
@@ -1,13 +1,14 @@
APP_ENV=production
APP_DEBUG=false
APP_URL=http://localhost
+APP_KEY=DontwaitfortheperfectmomentTakethemomentandmakeitperfect
DB_DRIVER=mysql
DB_HOST=mysql
DB_DATABASE=cachet
DB_USERNAME=cachet
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database
CACHET_EMOJI=false

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 06:43 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259625
Default Alt Text
(2 KB)

Event Timeline