Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3766709
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.arcconfig b/.arcconfig
new file mode 100644
index 0000000..54d81eb
--- /dev/null
+++ b/.arcconfig
@@ -0,0 +1,4 @@
+{
+ "repository.callsign": "DPIXEL",
+ "phabricator.uri": "https://devcentral.nasqueron.org"
+}
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..b2033c4
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,28 @@
+#
+# Nasqueron - Pixelfed image
+#
+
+FROM nasqueron/nginx-php7-fpm:novolume
+MAINTAINER Sébastien Santoro aka Dereckson <dereckson+nasqueron-docker@espace-win.org>
+
+#
+# Prepare the container
+#
+
+COPY files /
+
+WORKDIR /var/wwwroot/default
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ optipng pngquant jpegoptim gifsicle && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* && \
+ git init && git remote add origin https://github.com/pixelfed/pixelfed.git && \
+ git fetch && git checkout -t origin/dev && \
+ 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
index 0000000..ca697ed
--- /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/etc/service/horizon/run b/files/etc/service/horizon/run
new file mode 100755
index 0000000..dfb0390
--- /dev/null
+++ b/files/etc/service/horizon/run
@@ -0,0 +1,6 @@
+#!/bin/bash
+exec 2>&1
+source /usr/local/etc/envvars
+
+cd /var/wwwroot/default
+exec chpst -uapp /usr/local/bin/php artisan horizon:work
diff --git a/files/usr/local/bin/setup-container b/files/usr/local/bin/setup-container
new file mode 100755
index 0000000..9a22b09
--- /dev/null
+++ b/files/usr/local/bin/setup-container
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+pushd /var/wwwroot/default
+
+# Generates a unique application key in .env
+function generate_key {
+ KEY=`php artisan key:generate --show`
+ if [ -f .env ]; then
+ echo "" >> .env
+ fi
+ echo "APP_KEY=$KEY" >> .env
+}
+
+# Determines if APP_KEY is missing
+function is_app_key_missing {
+ if [ -v APP_KEY ]; then
+ return 0
+ fi
+
+ if [ ! -f .env ]; then
+ return 1
+ fi
+
+ grep -q 'APP_KEY=' .env
+ return $?
+}
+
+if [ -z "$NO_INSTALL" ]; then
+ is_app_key_missing
+ if [ $? -eq 1 ]; then
+ generate_key
+ fi
+ php artisan config:cache
+ php artisan storage:link
+ php artisan migrate --force
+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
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Nov 24, 19:41 (5 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2258795
Default Alt Text
(3 KB)
Attached To
Mode
rDPIXEL Docker image for Pixelfed
Attached
Detach File
Event Timeline
Log In to Comment