Page MenuHomeDevCentral

D246.diff
No OneTemporary

D246.diff

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+#
+# Nasqueron - Cachet image
+#
+
+FROM nasqueron/nginx-php-fpm:novolume
+MAINTAINER Nasqueron Organisation <docker@nasqueron.org>
+
+#
+# Prepare the container
+#
+
+COPY files /
+
+WORKDIR /var/wwwroot/default
+
+RUN git init && git remote add origin https://github.com/nasqueron/notifications.git && \
+ git fetch && git checkout -t origin/master && \
+ composer install --no-dev -o && \
+ chown -R app:app /var/wwwroot/default
+
+#
+# Run the container
+#
+
+CMD ["/usr/local/sbin/init-container"]
+
diff --git a/files/etc/nginx/sites-available/default b/files/etc/nginx/sites-available/default
new file mode 100644
--- /dev/null
+++ b/files/etc/nginx/sites-available/default
@@ -0,0 +1,22 @@
+server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+ server_name _;
+
+ root /var/wwwroot/default/public;
+
+ index index.php index.html index.htm;
+
+ location / {
+ try_files $uri /index.php$is_args$args;
+ }
+
+ location ~ \.php$ {
+ include snippets/fastcgi-php.conf;
+ fastcgi_pass 127.0.0.1:9000;
+ }
+
+ location ~ /\.ht {
+ deny all;
+ }
+}
diff --git a/files/usr/local/bin/setup-container b/files/usr/local/bin/setup-container
new file mode 100755
--- /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 /var/wwwroot/default
+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
--- /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

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 7, 16:23 (22 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2180652
Default Alt Text
D246.diff (1 KB)

Event Timeline