forked from liteerp-oss/liteerp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
105 lines (96 loc) · 3.13 KB
/
Copy pathDockerfile.server
File metadata and controls
105 lines (96 loc) · 3.13 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
96
97
98
99
100
101
102
103
104
105
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
FROM php:8.3-apache
# Add ARGs for syncing permissions
ARG UID=1000
ARG GID=1000
ENV UID=${UID}
ENV GID=${GID}
# Set Environment Variables
ENV DEBIAN_FRONTEND noninteractive
# Add User & Group IF NOT FOUND
RUN if getent group ${GID} >/dev/null 2>&1; then \
group_name=$(getent group ${GID} | cut -d: -f1); \
useradd -m -u ${UID} -g ${GID} -s /bin/bash www; \
else \
groupadd -g ${GID} www && \
useradd -m -u ${UID} -g www -s /bin/bash www; \
group_name=www; \
fi && \
# --- APACHE MODIFICATIONS ---
# Change Apache user from www-data to www (UID 1000)
sed -i "s/export APACHE_RUN_USER=www-data/export APACHE_RUN_USER=www/g" /etc/apache2/envvars && \
sed -i "s/export APACHE_RUN_GROUP=www-data/export APACHE_RUN_GROUP=${group_name}/g" /etc/apache2/envvars
# End previous RUN block; switch to new WORKDIR.
WORKDIR /var/www/html
#
#--------------------------------------------------------------------------
# Software's Installation
#--------------------------------------------------------------------------
#
# Installing tools and PHP extentions using "apt", "docker-php", "pecl",
#
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
# "libpng-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
RUN set -eux; \
apt-get update; \
apt-get upgrade -y; \
apt-get install -y --no-install-recommends \
curl \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
libssl-dev \
libwebp-dev \
libxpm-dev \
libmcrypt-dev \
libonig-dev \
libzip-dev \
zip \
build-essential \
autoconf \
automake \
bison \
flex \
re2c \
gdb \
libtool \
unzip; \
rm -rf /var/lib/apt/lists/*
RUN set -eux; \
# Install the PHP pdo_mysql extention
docker-php-ext-install pdo_mysql; \
# Install the PHP pdo_pgsql extention
docker-php-ext-install pdo_pgsql; \
# Install the PHP sockets extention
docker-php-ext-install sockets; \
# Install the PHP pcntl extention
docker-php-ext-install pcntl; \
# Install the PHP gd library
docker-php-ext-configure gd \
--prefix=/usr \
--with-jpeg \
--with-webp \
--with-xpm \
--with-freetype; \
docker-php-ext-install gd \
zip; \
php -r 'var_dump(gd_info());'
RUN pecl install redis \
&& docker-php-ext-enable redis
RUN apt-get update && apt-get install -y libicu-dev \
&& docker-php-ext-install intl
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN apt-get install -y nodejs
# Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Enable apache modules
RUN a2enmod rewrite headers
# Important, use User www (UID)
USER www