-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-alpine
48 lines (41 loc) · 1.91 KB
/
Dockerfile-alpine
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
# base
FROM alpine:3.20
ARG NGINX_VERSION=1.26.2
ENV TZ "Asia/Shanghai"
# conf
COPY conf/* /home/
COPY fastdfs.sh /usr/local/bin/
# run
# install packages
RUN set -eux \
# && sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories \
&& apk update \
&& apk add --no-cache --virtual .build-deps alpine-sdk build-base perl-dev openssl-dev pcre-dev zlib-dev git \
# git clone libfastcommon / libserverframe / fastdfs / fastdfs-nginx-module
&& mkdir /opt/tmp /opt/fastdfs \
&& cd /opt/tmp \
&& git clone -b V1.0.71 https://github.com/happyfish100/libfastcommon.git --depth 1 \
&& git clone -b V1.2.1 https://github.com/happyfish100/libserverframe.git --depth 1 \
&& git clone -b V6.11.0 https://github.com/happyfish100/fastdfs.git --depth 1 \
&& git clone -b V1.24 https://github.com/happyfish100/fastdfs-nginx-module.git --depth 1 \
&& wget https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz \
&& tar -zxvf nginx-$NGINX_VERSION.tar.gz \
# build libfastcommon, libserverframe, fastdfs
&& cd /opt/tmp/libfastcommon && ./make.sh && ./make.sh install \
&& cd /opt/tmp/libserverframe && ./make.sh && ./make.sh install \
&& cd /opt/tmp/fastdfs && ./make.sh && ./make.sh install \
# build nginx and add fastdfs-nginx-module
&& cd /opt/tmp/nginx-$NGINX_VERSION \
&& ./configure --add-module=/opt/tmp/fastdfs-nginx-module/src \
&& make && make install \
# cp script
&& cp /opt/tmp/fastdfs/init.d/fdfs_trackerd /usr/local/bin/fdfs_trackerd \
&& cp /opt/tmp/fastdfs/init.d/fdfs_storaged /usr/local/bin/fdfs_storaged \
&& chmod +x /usr/local/bin/fastdfs.sh /usr/local/bin/fdfs_trackerd /usr/local/bin/fdfs_storaged \
# cleanup
&& apk del .build-deps \
&& apk add --no-cache pcre-dev bash curl tzdata \
&& rm -rf /opt/tmp
VOLUME /opt/fastdfs
EXPOSE 22122 23000 80
CMD ["fastdfs.sh"]