1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-03-22 10:34:49 +00:00
This commit is contained in:
aiminick 2021-04-12 02:17:48 +08:00
parent cd798eb9b7
commit 156cfb40dd
22 changed files with 1069 additions and 319 deletions

View file

@ -6,7 +6,10 @@ EXPOSE 6080
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
RUN rm -rf /etc/apt/sources.list
ADD sources.list /etc/apt/sources.list
RUN apt clean all ; apt update ; apt upgrade -y
RUN echo 'APT::Get::Clean=always;' >> /etc/apt/apt.conf.d/99AutomaticClean
RUN apt-get update -qqy \
@ -20,7 +23,7 @@ RUN apt-get update -qqy \
zlib1g-dev \
nginx \
pkg-config \
gcc \
gcc g++ sudo \
libsasl2-modules \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -31,9 +34,9 @@ RUN chown -R www-data:www-data /srv/webvirtcloud
WORKDIR /srv/webvirtcloud
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip3 install -U pip && \
pip3 install wheel && \
pip3 install -r conf/requirements.txt && \
pip3 install -i https://pypi.doubanio.com/simple -U pip && \
pip3 install -i https://pypi.doubanio.com/simple wheel && \
pip3 install -i https://pypi.doubanio.com/simple -r conf/requirements.txt && \
chown -R www-data:www-data /srv/webvirtcloud
RUN . venv/bin/activate && \
@ -60,4 +63,11 @@ COPY conf/runit/webvirtcloud.sh /etc/service/webvirtcloud/run
# Define mountable directories.
#VOLUME []
RUN mkdir -p ~www-data/.ssh ; mkdir -p /var/www/.ssh ; chown www-data -R ~www-data
RUN echo 'Host *' >> ~www-data/.ssh/config ; echo 'StrictHostKeyChecking no' >> ~www-data/.ssh/config ; chown www-data -R ~www-data/.ssh/config
RUN sudo -u www-data ssh-keygen -t rsa -P "" -f ~www-data/.ssh/id_rsa
RUN rm -rf /root/.ssh ; ln -sf /var/www/.ssh /root/.ssh ; chgrp www-data /root ; chmod 770 /root
RUN echo 'sudo -u www-data ssh-copy-id $1' > /usr/bin/sudo-ssh-copy-id ; chmod +x /usr/bin/sudo-ssh-copy-id
RUN cp /usr/bin/sudo-ssh-copy-id / ; cp /usr/bin/sudo-ssh-copy-id /root/
WORKDIR /srv/webvirtcloud