forked from OPSnet/Gazelle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
121 lines (113 loc) · 3.88 KB
/
Dockerfile
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
FROM debian:bullseye-slim
ENV DEB_RELEASE bullseye
ENV DEBIAN_FRONTEND noninteractive
ENV PHP_VER 8.2
ENV NODE_VERSION 20
# Uncomment to skip the chromium download when installing puppeteer. If you do,
# you'll need to launch puppeteer with:
# browser.launch({executablePath: 'google-chrome-unstable'})
# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
WORKDIR /var/www
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
ca-certificates \
curl \
gnupg2 \
&& mkdir -p /etc/apt/keyrings \
&& curl -sL https://packages.sury.org/php/apt.gpg | apt-key add - \
&& echo "deb https://packages.sury.org/php/ $DEB_RELEASE main" | tee /etc/apt/sources.list.d/php.list \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
cron \
make \
nginx \
netcat \
nodejs \
php${PHP_VER}-cli \
php${PHP_VER}-common \
php${PHP_VER}-curl \
php${PHP_VER}-fpm \
php${PHP_VER}-gd \
php${PHP_VER}-mbstring \
php${PHP_VER}-memcached \
php${PHP_VER}-mysql \
php${PHP_VER}-pgsql \
php${PHP_VER}-xml \
php${PHP_VER}-zip \
php${PHP_VER}-apcu \
php${PHP_VER}-dev \
php${PHP_VER}-bcmath \
php${PHP_VER}-gmp \
php${PHP_VER}-xdebug \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
software-properties-common \
unzip \
yarn \
zlib1g-dev \
# Puppeteer layer
# This installs the necessary packages to run the bundled version of chromium for puppeteer
gconf-service \
libasound2 \
libatk1.0-0 \
libc6 \
libcairo2 \
libcups2 \
libdbus-1-3 \
libexpat1 \
libfontconfig1 \
libgcc1 \
libgconf-2-4 \
libgdk-pixbuf2.0-0 \
libglib2.0-0 \
libgtk-3-0 \
libnspr4 \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libstdc++6 \
libx11-6 \
libx11-xcb1 \
libxcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxi6 \
libxrandr2 \
libxrender1 \
libxss1 \
libxtst6 \
fonts-liberation \
libnss3 \
lsb-release \
xdg-utils \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
# Python tools layer
&& pip3 install chardet eac-logchecker xld-logchecker
COPY . /var/www
COPY --from=composer:2.6.6 /usr/bin/composer /usr/local/bin/composer
# Permissions and configuration layer
RUN useradd -ms /bin/bash gazelle \
&& chown -R gazelle:gazelle /var/www \
&& cp /var/www/.docker/web/php.ini /etc/php/${PHP_VER}/cli/php.ini \
&& cp /var/www/.docker/web/php.ini /etc/php/${PHP_VER}/fpm/php.ini \
&& cp /var/www/.docker/web/xdebug.ini /etc/php/${PHP_VER}/mods-available/xdebug.ini \
&& cp /var/www/.docker/web/www.conf /etc/php/${PHP_VER}/fpm/pool.d/www.conf \
&& cp /var/www/.docker/web/nginx.conf /etc/nginx/sites-available/gazelle.conf \
&& ln -s /etc/nginx/sites-available/gazelle.conf /etc/nginx/sites-enabled/gazelle.conf \
&& rm -f /etc/nginx/sites-enabled/default
EXPOSE 80/tcp
EXPOSE 3306/tcp
EXPOSE 34000/tcp
ENTRYPOINT [ "/bin/bash", "/var/www/.docker/web/entrypoint.sh" ]