forked from daspanel/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
87 lines (73 loc) · 2.93 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
#FROM daspanel/python2.7-gunicorn
FROM daspanel/alpine-base
MAINTAINER Abner G Jacobsen <[email protected]>
# Parse arguments for the build command.
ARG VERSION
ARG VCS_URL
ARG VCS_REF
ARG BUILD_DATE
# A little bit of metadata management.
# See http://label-schema.org/
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vendor="DASPANEL" \
org.label-schema.version=$VERSION \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.name="base-api" \
org.label-schema.description="This service provides a web interface to Daspanel." \
org.label-schema.architecture="x86_64" \
org.label-schema.distribution="Alpine Linux" \
org.label-schema.distribution-version="3.5" \
info.daspanel.panel=$VERSION
ENV INSTALL_PATH /opt/daspanel/apps/panel
RUN mkdir -p $INSTALL_PATH
# Inject files in container file system
COPY container_data /
COPY daspanel_web /opt/daspanel/apps/panel/daspanel_web
COPY config.py wsgi.py requirements.txt /opt/daspanel/apps/panel/
WORKDIR $INSTALL_PATH
#RUN apk add --no-cache --virtual .build-deps \
# build-base libffi-dev mariadb-dev python-dev libxml2-dev libxslt-dev \
# && pip install -r $INSTALL_PATH/requirements.txt \
# && find /usr/local \
# \( -type d -a -name test -o -name tests \) \
# -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
# -exec rm -rf '{}' + \
# && find /usr \
# \( -type d -a -name test -o -name tests \) \
# -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
# -exec rm -rf '{}' + \
# && runDeps="$( \
# scanelf --needed --nobanner --recursive /usr \
# | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
# | sort -u \
# | xargs -r apk info --installed \
# | sort -u \
# )" \
# && apk add --virtual .rundeps $runDeps \
# && apk del .build-deps
RUN apk add --no-cache --update --virtual .build-deps \
#build-base libffi-dev mariadb-dev python-dev libxml2-dev libxslt-dev \
build-base bash gcc musl-dev git libressl-dev curl curl-dev python-dev libffi-dev \
mariadb-dev python-dev libxml2-dev libxslt-dev \
# Install python, pip
&& apk add --no-cache --update libssl1.0 libcurl python libxslt \
&& curl "https://bootstrap.pypa.io/get-pip.py" | python \
# Install pyCurl
&& export PYCURL_SSL_LIBRARY=openssl \
&& pip install --compile pycurl==7.43.0 \
# Install basic python packages used by Daspanel
&& pip install gunicorn==19.7.1 setproctitle gevent \
# Install pip packages
&& pip install -r $INSTALL_PATH/requirements.txt \
# Cleanup
&& apk --purge -v del .build-deps \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/src \
&& rm -rf /tmp/*
EXPOSE 5000
# Volumes
# - Conf: /etc/php/ (php-fpm.conf, php.ini)
# - Logs: /var/log/php
# - Data: /srv/www, /var/lib/php/session