-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
56 lines (46 loc) · 1.3 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
FROM alpine:latest AS build
ENV \
NGINX_VERSION=1.26.2 \
LIBMODJPEG_VERSION=1.0.2
RUN apk add --update \
binutils \
wget \
coreutils \
gcc \
g++ \
make \
cmake \
pcre-dev \
zlib-dev \
jpeg-dev \
libpng-dev
RUN \
mkdir /dist && cd /dist && \
wget "https://github.com/ioppermann/libmodjpeg/archive/v${LIBMODJPEG_VERSION}.tar.gz" && \
tar -xzvf "v${LIBMODJPEG_VERSION}.tar.gz" && \
cd libmodjpeg-${LIBMODJPEG_VERSION} && \
cmake . && \
make -j$(nproc) && \
make install && \
rm -rf ${DIR}
ADD config /dist/modjpeg-nginx/config
ADD ngx_http_jpeg_filter_module.c /dist/modjpeg-nginx/ngx_http_jpeg_filter_module.c
RUN \
cd /dist && \
wget "http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz" && \
tar -xzvf "nginx-${NGINX_VERSION}.tar.gz" && \
cd nginx-${NGINX_VERSION} && \
./configure --prefix=/usr/local/nginx --add-module=/dist/modjpeg-nginx && \
make -j$(nproc) && \
make install && \
rm -rf ${DIR}
FROM alpine:latest
COPY --from=build /usr/local/nginx /usr/local/nginx
COPY --from=build /usr/local/lib /usr/local/lib
COPY --from=build /usr/lib /usr/lib
ADD contrib/modjpeg.conf.in /usr/local/nginx/conf/modjpeg.conf.in
ADD contrib/dropon.png /usr/local/nginx/conf/dropon.png
ADD contrib/run.sh /usr/local/nginx/bin/run.sh
EXPOSE 80/tcp
VOLUME ["/images"]
CMD ["/usr/local/nginx/bin/run.sh"]