summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/docker-compose.yml30
-rw-r--r--docker/mariadb/Dockerfile4
-rw-r--r--docker/php/Dockerfile4
-rw-r--r--docker/php/etc/php/conf.d/extensions.ini4
-rwxr-xr-xdocker/restart6
-rwxr-xr-xdocker/start12
-rwxr-xr-xdocker/stop5
7 files changed, 65 insertions, 0 deletions
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
new file mode 100644
index 0000000..f799bd6
--- /dev/null
+++ b/docker/docker-compose.yml
@@ -0,0 +1,30 @@
+version: "3.3"
+
+volumes:
+ db-socket:
+ db-data:
+
+services:
+ app:
+ build: php
+ working_dir: /app
+ command: php -S 0.0.0.0:${PORT:-8080} -t /app
+ user: http
+ ports:
+ - "${PORT:-8080}:${PORT:-8080}"
+ volumes:
+ - ../:/app
+ - db-socket:/run/mysqld
+ tmpfs:
+ - /app/cache
+ depends_on:
+ - db
+
+ db:
+ build: mariadb
+ command: mysqld
+ user: mysql
+ network_mode: none
+ volumes:
+ - db-data:/var/lib/mysql
+ - db-socket:/run/mysqld
diff --git a/docker/mariadb/Dockerfile b/docker/mariadb/Dockerfile
new file mode 100644
index 0000000..b11b9a0
--- /dev/null
+++ b/docker/mariadb/Dockerfile
@@ -0,0 +1,4 @@
+FROM archlinux/base
+
+RUN pacman -Syu --noconfirm mariadb
+RUN mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql --auth-root-authentication-method=normal
diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile
new file mode 100644
index 0000000..90d82e3
--- /dev/null
+++ b/docker/php/Dockerfile
@@ -0,0 +1,4 @@
+FROM archlinux/base
+
+RUN pacman -Syu --noconfirm php php-apcu php-apcu-bc
+ADD etc/ /etc
diff --git a/docker/php/etc/php/conf.d/extensions.ini b/docker/php/etc/php/conf.d/extensions.ini
new file mode 100644
index 0000000..fa6402f
--- /dev/null
+++ b/docker/php/etc/php/conf.d/extensions.ini
@@ -0,0 +1,4 @@
+[PHP]
+extension=mysqli.so
+extension=apcu.so
+extension=apc.so
diff --git a/docker/restart b/docker/restart
new file mode 100755
index 0000000..06c6aa5
--- /dev/null
+++ b/docker/restart
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+pushd $(dirname $BASH_SOURCE)
+
+./stop
+./start
diff --git a/docker/start b/docker/start
new file mode 100755
index 0000000..921b80f
--- /dev/null
+++ b/docker/start
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+pushd $(dirname $BASH_SOURCE)
+
+if [[ -n "$(docker-compose ps -q)" ]]; then
+ echo "Service already running" >&2
+ exit 1
+fi
+
+docker-compose up --build -d
+docker-compose exec db mysqladmin -uroot --wait=10 ping
+docker-compose exec db mysqladmin -uroot create fluxbb
diff --git a/docker/stop b/docker/stop
new file mode 100755
index 0000000..732c654
--- /dev/null
+++ b/docker/stop
@@ -0,0 +1,5 @@
+#!/usr/bin/env bash
+
+pushd $(dirname $BASH_SOURCE)
+
+docker-compose down -v