-
Notifications
You must be signed in to change notification settings - Fork 180
/
Dockerfile
66 lines (53 loc) · 2.74 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
# See https://hub.docker.com/r/phusion/baseimage/tags/
FROM phusion/baseimage:focal-1.2.0
ENV SEAFILE_SERVER=seafile-server SEAFILE_VERSION=
RUN echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
| tee /etc/apt/sources.list.d/nginx.list \
&& curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
# Security
RUN apt-get update --fix-missing && apt-get upgrade -y
# Utility tools
RUN apt-get install -y vim htop net-tools psmisc wget curl git unzip
# For suport set local time zone.
RUN export DEBIAN_FRONTEND=noninteractive && apt-get install -y tzdata \
nginx \
libmysqlclient-dev \
libmemcached11 libmemcached-dev \
fuse \
ldap-utils ca-certificates
# Python3
RUN apt-get install -y python3 python3-pip python3-setuptools && \
rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python && \
python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/ && rm -r /root/.cache/pip
RUN pip3 install --timeout=3600 click termcolor colorlog pymysql django==3.2.* \
future==0.18.* mysqlclient==2.1.* pillow==10.2.* pylibmc captcha==0.5.* markupsafe==2.0.1 jinja2 \
sqlalchemy==1.4.3 django-pylibmc django_simple_captcha==0.5.20 pyjwt==2.6.* djangosaml2==1.5.* pysaml2==7.2.* pycryptodome==3.16.* cffi==1.15.1 psd-tools lxml \
-i https://pypi.tuna.tsinghua.edu.cn/simple/ && rm -r /root/.cache/pip
# Scripts
COPY scripts_10.0 /scripts
COPY templates /templates
COPY services /services
# acme
# RUN curl https://get.acme.sh | sh -s
RUN unzip /scripts/acme.sh-master.zip -d /scripts/ && \
mv /scripts/acme.sh-master /scripts/acme.sh && \
cd /scripts/acme.sh && /scripts/acme.sh/acme.sh --install
RUN echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf && \
chmod u+x /scripts/* && rm /scripts/cluster* && \
mkdir -p /etc/my_init.d && \
rm -f /etc/my_init.d/* && \
cp /scripts/create_data_links.sh /etc/my_init.d/01_create_data_links.sh && \
mkdir -p /etc/service/nginx && \
mkdir -p /etc/nginx/sites-enabled && mkdir -p /etc/nginx/sites-available && \
rm -f /etc/nginx/sites-enabled/* /etc/nginx/conf.d/* && \
mv /services/nginx.conf /etc/nginx/nginx.conf && \
mv /services/nginx.sh /etc/service/nginx/run
# Seafile
WORKDIR /opt/seafile
RUN mkdir -p /opt/seafile/ && cd /opt/seafile/ && \
wget https://seafile-downloads.oss-cn-shanghai.aliyuncs.com/seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \
tar -zxvf seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \
rm -f seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \
find /opt/seafile/ \( -name "liblber-*" -o -name "libldap-*" -o -name "libldap_r*" -o -name "libsasl2.so*" -o -name "libcrypt.so.1" \) -delete
EXPOSE 80
CMD ["/sbin/my_init", "--", "/scripts/enterpoint.sh"]