Skip to content

Commit 8f8d8d6

Browse files
committed
Revert "Modify the path of s6, delete README.md.x & add s6 by debian package"
This reverts commit cadea5f.
1 parent cadea5f commit 8f8d8d6

3 files changed

Lines changed: 164 additions & 10 deletions

File tree

debian12/Dockerfile

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
# Mongo support
77
#
88

9-
FROM debian:12
9+
FROM debian:bookworm
1010

1111
# Component Versions
1212
ENV \
13-
BASHCONTAINER_VERSION=0.8.0 BASHCONTAINER_SHA256=0ddc93b11fd8d6ac67f6aefbe4ba790550fc98444e051e461330f10371a877f1 \
13+
BASHCONTAINER_VERSION=0.7.2 BASHCONTAINER_SHA256=87c4b804f0323d8f0856cb4fbf2f7859174765eccc8b0ac2d99b767cecdcf5c6 \
1414
PHPEXTRAS_VERSION=0.1.0 PHPEXTRAS_SHA256=515af5789d5180123acfac9b1090f46e07f355c8df51a34e27ada5f7da0495cc
1515

1616
# Change the www-data use to uid and gid 48 to match other containers
@@ -38,9 +38,9 @@ RUN set -x \
3838

3939
# Install gomplate
4040
RUN set -x \
41-
&& GOMPLATE_VERSION=v3.11.6 \
42-
&& GOMPLATE_CHECKSUM_X86_64=7ce8f9f89a0b21fac05b8412af4dd8a06f9e5d8a2df70370549d2dde5f9f0d75 \
43-
&& GOMPLATE_CHECKSUM_AARCH64=f41b6cfaebd9c744c3091993baf9ca44cd80e07d63143d2e78457a159fc22dc5 \
41+
&& GOMPLATE_VERSION=v3.11.5 \
42+
&& GOMPLATE_CHECKSUM_X86_64=16f6a01a0ff22cae1302980c42ce4f98ca20f8c55443ce5a8e62e37fc23487b3 \
43+
&& GOMPLATE_CHECKSUM_AARCH64=fd980f9d233902e50f3f03f10ea65f36a2705385358a87aa18b19fb7cdf54c1d \
4444
&& if [ "$(uname -m)" = "x86_64" ] ; then \
4545
GOMPLATE_CHECKSUM="${GOMPLATE_CHECKSUM_X86_64}"; \
4646
GOMPLATE_ARCH="amd64"; \
@@ -57,8 +57,30 @@ RUN set -x \
5757

5858
# Install s6
5959
RUN set -x \
60-
&& apt-get update \
61-
&& apt-get install -y --no-install-recommends s6 \
60+
&& S6_VERSION=2.11.0.0 \
61+
&& EXECLINE_VERSION=2.8.1.0 \
62+
&& SKAWARE_RELEASE=2.0.7 \
63+
&& S6_CHECKSUM_X86_64=fcf79204c1957016fc88b0ad7d98f150071483583552103d5822cbf56824cc87 \
64+
&& S6_CHECKSUM_AARCH64=64151e136f887c6c2c7df69e3100573c318ec7400296680cc698bc7b0ca36943 \
65+
&& EXECLINE_CHECKSUM_X86_64=b216cfc4db928729d950df5a354aa34bc529e8250b55ab0de700193693dea682 \
66+
&& EXECLINE_CHECKSUM_AARCH64=8cb1d5c2d44cb94990d63023db48f7d3cd71ead10cbb19c05b99dbd528af5748 \
67+
&& if [ "$(uname -m)" = "x86_64" ] ; then \
68+
S6_CHECKSUM="${S6_CHECKSUM_X86_64}"; \
69+
EXECLINE_CHECKSUM="${EXECLINE_CHECKSUM_X86_64}"; \
70+
SKAWARE_ARCH="amd64"; \
71+
elif [ "$(uname -m)" = "aarch64" ]; then \
72+
S6_CHECKSUM="${S6_CHECKSUM_AARCH64}"; \
73+
EXECLINE_CHECKSUM="${EXECLINE_CHECKSUM_AARCH64}"; \
74+
SKAWARE_ARCH="aarch64"; \
75+
fi \
76+
&& curl -sSf -L -o /tmp/s6-${S6_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz https://github.com/just-containers/skaware/releases/download/v${SKAWARE_RELEASE}/s6-${S6_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz \
77+
&& curl -sSf -L -o /tmp/execline-${EXECLINE_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz https://github.com/just-containers/skaware/releases/download/v${SKAWARE_RELEASE}/execline-${EXECLINE_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz \
78+
&& echo "${S6_CHECKSUM} s6-${S6_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz" > /tmp/SHA256SUM \
79+
&& echo "${EXECLINE_CHECKSUM} execline-${EXECLINE_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz" >> /tmp/SHA256SUM \
80+
&& ( cd /tmp; sha256sum -c SHA256SUM || ( echo "Expected S6: $(sha256sum s6-${S6_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz) Execline: $(sha256sum execline-${EXECLINE_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz)"; exit 1; )) \
81+
&& tar -C /usr/local -zxf /tmp/s6-${S6_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz \
82+
&& tar -C /usr/local -zxf /tmp/execline-${EXECLINE_VERSION}-linux-${SKAWARE_ARCH}-bin.tar.gz \
83+
&& rm -rf /tmp/* \
6284
;
6385

6486
# Install PHP Extras
@@ -134,8 +156,8 @@ RUN \
134156
phpenmod auto && \
135157
a2enconf php8.2-fpm && \
136158
a2enmod proxy_fcgi remoteip rewrite headers
137-
159+
138160
ENV TMPDIR=/var/tmp TERM=dumb
139161
EXPOSE 8000
140162
ENTRYPOINT ["/entry.sh"]
141-
CMD ["s6"]
163+
CMD ["s6"]

debian12/README.md.x

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# PHP-Apache Debian 12 (Bookworm)
2+
3+
This is an Apache and php-fpm image:
4+
5+
- Base: Debian 12 (Bookworm)
6+
- Apache httpd: 2.4
7+
- PHP: 8.2
8+
9+
This image is designed to be quite configurable and as such is good for getting
10+
started but probably not a great base if you want a highly optimised container.
11+
This image also expects to be used behind a load balancer and as such does not
12+
listen on port 80 but instead port 8000. Also make note of how to handle SSL
13+
offloading to the load balancer and how this affects .htaccess rules.
14+
15+
## Options:
16+
17+
All options are optional.
18+
The values shown here are the defaults. The options listed here are also case sensitive.
19+
20+
### Global
21+
22+
```
23+
timeout = 30
24+
TZ = UTC
25+
```
26+
27+
### HTTPD
28+
29+
```
30+
httpd_remoteipheader = X-Forwarded-For
31+
httpd_remoteipinternalproxy = (unset)
32+
33+
# Subdirectory within the git repository that contains the site root eg 'www'
34+
httpd_root = (unset)
35+
36+
# If unset the following is used
37+
RemoteIPInternalProxy 10.0.0.0/8
38+
RemoteIPInternalProxy 172.16.0.0/12
39+
RemoteIPInternalProxy 192.168.0.0/16
40+
```
41+
42+
### PHP/PHP-FPM
43+
44+
```
45+
phpopts_ = (unset)
46+
47+
# phpopts Examples
48+
phpopts_short_open_tag = off
49+
phpopts_post_max_size = 8M
50+
phpopts_upload_max_filesize = 2M
51+
phpopts_memory_limit = 128M
52+
53+
# PHP Cache options
54+
php_cache = (opcache|none) default is opcache, none doesn't load any cache extensions.
55+
php_apc_shm_size = 64M # This is for the apcu extension
56+
php_opcache_memory_consumption = 128
57+
php_opcache_revalidate_freq = 2
58+
59+
# PHP Session options
60+
php_session_save_handler = (unset)
61+
php_session_save_path = (unset)
62+
63+
# PHP Session examples
64+
php_session_save_handler = redis
65+
php_session_save_path = "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2"
66+
67+
php_session_save_handler = memcached
68+
php_session_save_path = "host:11211"
69+
70+
# PHP-FPM options
71+
phpfpm_pm_max_children = 3
72+
phpfpm_pm_max_requests = 500
73+
```
74+
75+
### Email/msmtp
76+
77+
msmtp expects a from address to be set either via environment variable (`msmtp_from`) or
78+
in the php mail() function. eg. `mail('nobody@example.com', 'the subject',
79+
'the message', null, '-fwebmaster@example.com');`
80+
81+
msmtp also need a host to send email via, it does not queue and forward mail
82+
like postfix or exim. This could be defined via a docker link `--link
83+
smtp:smtp`
84+
85+
```
86+
msmtp_host = SMTP_PORT_25_TCP_ADDR or mail
87+
msmtp_port = SMTP_PORT_25_TCP_PORT or 25
88+
msmtp_from = (unset)
89+
msmtp_user = (unset)
90+
msmtp_pass = (unset)
91+
```
92+
93+
## PHP Pre Execution
94+
95+
PHP pre-execution helpers are included in this image. See
96+
[PHP Extras](https://github.com/panubo/php-extras) for more information.
97+
98+
Set `auto_prepend_file=xxxx_prepend.php` to enable.
99+
100+
## SSL Offloading
101+
102+
This container should be used behind a load balancing reverse proxy and as such
103+
SSL should be offloaded to the load balancer. However, this can cause issues
104+
when your applications want to know if they are being served over SSL as the
105+
local webserver cannot determine this. Below are workarounds for the two most common
106+
issues.
107+
108+
If you want to redirect users from a non-ssl connection to a SSL connection with
109+
htaccess and mod_rewrite the following rules work both behind an SSL offloading
110+
load balancer and also when the local webserver is handling the SSL.
111+
112+
```
113+
<IfModule mod_rewrite.c>
114+
RewriteEngine on
115+
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
116+
RewriteCond %{HTTPS} !=on
117+
RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R=301,L]
118+
</IfModule>
119+
```
120+
121+
Some PHP application also check they are running on an SSL connection. As the
122+
local webserver doesn't set $_SERVER['HTTPS'] correctly when behind a proxy the
123+
following code can be used to fix the issue.
124+
125+
```php
126+
/* Set _SERVER['HTTPS'] correctly when behind a proxy setting HTTP_X_FORWARDED_PROTO */
127+
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
128+
$_SERVER['HTTPS'] = 'on';
129+
}
130+
```
131+
132+
or set `auto_prepend_file=SSLHelper_prepend.php` to use the SSL Helper from the [PHP Extras](https://github.com/panubo/php-extras) repo.

debian12/root/Procfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
s6: /usr/bin/s6-svscan /etc/s6
1+
s6: /usr/local/bin/s6-svscan /etc/s6

0 commit comments

Comments
 (0)