-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.contrib
More file actions
95 lines (86 loc) · 4.11 KB
/
Copy pathDockerfile.contrib
File metadata and controls
95 lines (86 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# =============================================================================
# TYPO3 Contribution Image
# Uses a host-side(!) GIT checkout and set it up for Core contributions
# as a composer-based project.
#
# @TODO - When finalized, this must go into a readme.
# @TODO - Adjust github builds
#
# Usage:
# 0.) Have an (empty) working directory:
#
# $> mkdir ~/TYPO3-Contrib && cd ~/TYPO3-Contrib
#
# 1.) Now you need the `docker-compose.contrib-public.yml` file, get it from
# this repository:
#
# $> wget https://raw.githubusercontent.com/TYPO3incubator/typo3-base/refs/heads/main/docker-compose.contrib-public.yml
#
# 2.) Now start the docker framework:
#
# $> docker compose -f docker-compose.contrib-public.yml up
#
# 3.) See the logs and access your setup via http://localhost:28080/typo3/
#
# 4.) You can require composer packages by entering the web container to execute "composer" commands
# (the `typo3config/composer.json` file will be persisted via mount)
#
# $> docker compose -f docker-compose.contrib-public.yml exec web composer require "georgringer/news:*"
#
# =============================================================================
# Use minimum PHP version for contribution development
ARG PHP_VERSION=8.2
# -----------------------------------------------------------------------------
# Stage 1: Install TYPO3 via Composer
# -----------------------------------------------------------------------------
FROM ghcr.io/typo3incubator/typo3-base:${PHP_VERSION}-nginx AS build
LABEL org.opencontainers.image.title="TYPO3 Contribution Image"
LABEL org.opencontainers.image.description="Ready-to-run TYPO3 main contribution setup with Apache"
# Minimal subset of docker-entrypoint.sh initialization,
# note that MAX_EXECUTION_TIME = 0 for contrib/dev setup!
RUN bash -c '\
if [ -f "/etc/php/${PHP_VERSION}/fpm/conf.d/99-typo3.ini" ]; then \
sed -i \
-e "s|\${PHP_MEMORY_LIMIT}|${PHP_MEMORY_LIMIT:-512M}|g" \
-e "s|\${PHP_MAX_EXECUTION_TIME}|${PHP_MAX_EXECUTION_TIME:-0}|g" \
-e "s|\${PHP_UPLOAD_MAX_FILESIZE}|${PHP_UPLOAD_MAX_FILESIZE:-32M}|g" \
-e "s|\${PHP_POST_MAX_SIZE}|${PHP_POST_MAX_SIZE:-32M}|g" \
-e "s|\${PHP_MAX_INPUT_VARS}|${PHP_MAX_INPUT_VARS:-1500}|g" \
"/etc/php/${PHP_VERSION}/fpm/conf.d/99-typo3.ini"; \
fi && \
if [ -f "/etc/php/${PHP_VERSION}/cli/conf.d/99-typo3.ini" ]; then \
sed -i \
-e "s|\${PHP_MEMORY_LIMIT}|${PHP_MEMORY_LIMIT:-512M}|g" \
-e "s|\${PHP_MAX_EXECUTION_TIME}|${PHP_MAX_EXECUTION_TIME:-0}|g" \
-e "s|\${PHP_UPLOAD_MAX_FILESIZE}|${PHP_UPLOAD_MAX_FILESIZE:-32M}|g" \
-e "s|\${PHP_POST_MAX_SIZE}|${PHP_POST_MAX_SIZE:-32M}|g" \
-e "s|\${PHP_MAX_INPUT_VARS}|${PHP_MAX_INPUT_VARS:-1500}|g" \
"/etc/php/${PHP_VERSION}/cli/conf.d/99-typo3.ini"; \
fi'
# Install Apache with PHP-FPM proxy support
# hadolint ignore=DL3008
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends apache2; \
# Enable required modules
a2enmod proxy proxy_fcgi rewrite headers filter expires mime alias deflate setenvif; \
# Disable default site
a2dissite 000-default; \
# Allow Apache (www-data) to access PHP-FPM socket (owned by typo3:typo3)
usermod -aG typo3 www-data; \
# Cleanup
apt-get clean; \
rm -rf /var/lib/apt/lists/*
# Apache vhost with AllowOverride All for .htaccess support
COPY contrib/config/apache/apache-typo3.conf /etc/apache2/sites-available/typo3.conf
RUN a2ensite typo3
COPY contrib/config/supervisor/supervisord.conf /etc/supervisord.conf
CMD ["supervisord", "-c", "/etc/supervisord.conf"]
#@todo - This is probably needed for linux; where to set this
# so that the handoff to init.sh entrypoint still works?
# and the files below (and these by init.sh should be attributed to typo3)
#USER typo3
COPY --chown=typo3:typo3 --chmod=755 contrib/init.sh /var/www/html/init.sh
COPY --chown=typo3:typo3 contrib/composer.json /var/www/html/dist.composer.json
COPY --chown=typo3:typo3 contrib/gitmessage.txt /var/www/html/dist.gitmessage.txt
EXPOSE 80