Skip to content

Commit

Permalink
Build with memcache
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Nov 18, 2024
1 parent 88fafd7 commit dc09cfb
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ RUN \
grep -qxF 'clear_env = no' /etc/php82/php-fpm.d/www.conf || echo 'clear_env = no' >> /etc/php82/php-fpm.d/www.conf && \
echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php82/php-fpm.conf

# install sqlite3
RUN apk add --no-cache php82-sqlite3
RUN apk --no-cache add \
# Database
php82-sqlite3 \
# Memcache
memcached \
php82-pecl-memcached

# healthchecks
HEALTHCHECK --interval=60s --timeout=30s --start-period=180s --start-interval=10s --retries=5 \
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions root/app/www/public/startup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
----------------------------------
------ Created: 111824 ------
------ Austin Best ------
----------------------------------
*/

echo date('c') . ' startup.php ->' . "\n";

error_reporting(E_ERROR | E_PARSE);

if (!defined('ABSOLUTE_PATH')) {
define('ABSOLUTE_PATH', __DIR__ . '/');
}

echo 'require_once ' . ABSOLUTE_PATH . 'loader.php' . "\n";
require_once ABSOLUTE_PATH . 'loader.php';

$command = 'memcached -u abc > /dev/null 2>&1 &';

echo date('c') . ' starting memcached \'' . $command . '\'' . "\n";
$shell->exec($command);

echo date('c') . ' startup.php <-' . "\n";
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions root/etc/s6-overlay/s6-rc.d/init-starrproxy-config/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

echo 's6-overlay init require(/app/www/public/startup.php) ->';
s6-setuidgid abc php -r "require '/app/www/public/startup.php';"
echo 's6-overlay init require(/app/www/public/startup.php) <-';
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-starrproxy-config/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oneshot
1 change: 1 addition & 0 deletions root/etc/s6-overlay/s6-rc.d/init-starrproxy-config/up
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-starrproxy-config/run
Empty file.

0 comments on commit dc09cfb

Please sign in to comment.