This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
97 lines (84 loc) · 2.58 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
FROM nginx:mainline-alpine
MAINTAINER Christian Haschek <office@haschek-solutions.com>
ENV S6_VERSION v1.22.1.0
# Add PHP 7
RUN set -x \
&& apk upgrade -U \
&& apk --update \
# --repository=http://dl-4.alpinelinux.org/alpine/edge/testing \
add \
openssl \
nano \
ffmpeg \
file \
unzip \
bash \
curl \
php7 \
php7-pdo \
php7-exif \
php7-mcrypt \
php7-curl \
php7-gd \
php7-json \
php7-fpm \
php7-openssl \
php7-ctype \
php7-opcache \
php7-mbstring \
php7-sodium \
php7-xml \
php7-ftp \
php7-simplexml \
php7-session \
php7-fileinfo \
php7-pcntl \
&& rm -rf /var/cache/apk/*
# s6 overlay
# all supported architectures look at "assets" on
# https://github.com/just-containers/s6-overlay/releases
RUN /bin/bash -c 'set -ex && \
ARCH="$(apk --print-arch)" && \
case "${ARCH##*-}" in \
x86_64) S6_PLATFORM="amd64" ;; \
armv7l) S6_PLATFORM="armhf" ;; \
armv7) S6_PLATFORM="armhf" ;; \
armv6) S6_PLATFORM="armhf" ;; \
armhf) S6_PLATFORM="armhf" ;; \
arm) S6_PLATFORM="arm" ;; \
aarch64) S6_PLATFORM="aarch64" ;;\
i386) S6_PLATFORM="x86" ;;\
*) echo >&2 "unsupported architecture: ${ARCH}"; exit 1 ;; \
esac; \
curl -L -s https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_PLATFORM}.tar.gz \
| tar xvzf - -C / '
COPY /rootfs /
RUN set -x \
&& rm /usr/bin/php \
&& ln -s /etc/php7 /etc/php \
&& ln -s /usr/bin/php7 /usr/bin/php \
&& ln -s /usr/sbin/php-fpm7 /usr/bin/php-fpm \
&& ln -s /usr/lib/php7 /usr/lib/php \
# && ln -s /dev/stdout /var/log/nginx/access.log \
# && ln -s /dev/stderr /var/log/nginx/error.log \
&& mkdir -p /var/log/php-fpm \
&& ln -s /dev/stderr /var/log/php-fpm/fpm-error.log
# Enable default sessions
RUN set -x \
&& mkdir -p /var/lib/php7/sessions \
&& chown nginx:nginx /var/lib/php7/sessions
# ADD SOURCE
RUN set -x \
&& mkdir -p /usr/share/nginx/html
WORKDIR /usr/share/nginx/html
RUN set -x \
&& curl --silent --remote-name https://codeload.github.com/HaschekSolutions/pictshare/zip/master \
&& unzip -q master \
&& mv pictshare-master/* . \
&& rm -r master pictshare-master \
&& mv inc/example.config.inc.php inc/config.inc.php \
&& chown -R nginx:nginx /usr/share/nginx/html \
&& chmod +x bin/ffmpeg
VOLUME /usr/share/nginx/html/data
EXPOSE 80
ENTRYPOINT ["bash", "/pictshare.sh"]