-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile-dev
80 lines (70 loc) · 2.83 KB
/
Dockerfile-dev
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
FROM php:5-apache
ENV APACHE_DOCUMENT_ROOT /project/kofradia/public
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
dirmngr \
git \
gnupg2 \
graphviz \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libxslt1-dev \
zlib1g-dev \
; \
rm -rf /var/lib/apt/lists/*; \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-install -j$(nproc) \
bcmath \
gd \
pdo_mysql \
xsl \
zip \
; \
sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf; \
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf; \
a2enmod rewrite
# Install nodejs
# From https://github.com/nodejs/docker-node/blob/3e179a85703a6688a26486729b4466a92e818a84/10/stretch/Dockerfile
# gpg keys listed at https://github.com/nodejs/node#release-team
ENV NODE_VERSION 10.6.0
RUN set -eux; \
for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \
71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
B9AE9905FFD7803F25714661B63B535A4C206CA9 \
56730D5401028683275BD23C23EFEFE93C4CFFFE \
77984A986EBC2AA786BC0F66B01FBB92821C587A \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
; do \
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$key" || \
gpg --keyserver hkp://ipv4.pool.sks-keyservers.net --recv-keys "$key" || \
gpg --keyserver hkp://pgp.mit.edu:80 --recv-keys "$key" ; \
done; \
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz"; \
curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc"; \
gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc; \
grep " node-v$NODE_VERSION-linux-x64.tar.xz\$" SHASUMS256.txt | sha256sum -c -; \
tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 --no-same-owner; \
rm "node-v$NODE_VERSION-linux-x64.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt; \
ln -s /usr/local/bin/node /usr/local/bin/nodejs
RUN set -eux; \
npm install -g uglifycss
COPY container/run-dev.sh /run-dev.sh
COPY container/entrypoint.sh /entrypoint.sh
COPY --from=composer /usr/bin/composer /usr/bin/composer
# The user we want to switch to when running.
# See entrypoint.sh for description.
ENV CONTAINER_USER app
# The file to copy uid/gid from when creating user.
ENV CONTAINER_USERFILE README.md
ENV APACHE_RUN_USER app
ENV APACHE_RUN_GROUP app
WORKDIR /project/kofradia
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/run-dev.sh"]