Skip to content

Commit dc09cfb

Browse files
committed
Build with memcache
1 parent 88fafd7 commit dc09cfb

File tree

9 files changed

+40
-2
lines changed

9 files changed

+40
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ RUN \
1515
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
1616
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf
1717

18-
# install sqlite3
19-
RUN apk add --no-cache php82-sqlite3
18+
RUN apk --no-cache add \
19+
# Database
20+
php82-sqlite3 \
21+
# Memcache
22+
memcached \
23+
php82-pecl-memcached
2024

2125
# healthchecks
2226
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --start-interval=10s --retries=5 \

root/app/www/public/startup.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
/*
4+
----------------------------------
5+
------ Created: 111824 ------
6+
------ Austin Best ------
7+
----------------------------------
8+
*/
9+
10+
echo date('c') . ' startup.php ->' . "\n";
11+
12+
error_reporting(E_ERROR | E_PARSE);
13+
14+
if (!defined('ABSOLUTE_PATH')) {
15+
define('ABSOLUTE_PATH', __DIR__ . '/');
16+
}
17+
18+
echo 'require_once ' . ABSOLUTE_PATH . 'loader.php' . "\n";
19+
require_once ABSOLUTE_PATH . 'loader.php';
20+
21+
$command = 'memcached -u abc > /dev/null 2>&1 &';
22+
23+
echo date('c') . ' starting memcached \'' . $command . '\'' . "\n";
24+
$shell->exec($command);
25+
26+
echo date('c') . ' startup.php <-' . "\n";

root/etc/s6-overlay/s6-rc.d/init-config-end/dependencies.d/init-starrproxy-config

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/init-starrproxy-config/dependencies.d/init-nginx-end

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
3+
4+
echo 's6-overlay init require(/app/www/public/startup.php) ->';
5+
s6-setuidgid abc php -r "require '/app/www/public/startup.php';"
6+
echo 's6-overlay init require(/app/www/public/startup.php) <-';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oneshot
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-starrproxy-config/run

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-starrproxy-config

Whitespace-only changes.

0 commit comments

Comments
 (0)