-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-test
38 lines (33 loc) · 1.66 KB
/
Dockerfile-test
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
FROM ubuntu
COPY ./bin/* /usr/local/bin/
RUN chmod u=rwx,go=rx /usr/local/bin/* \
&& cp /etc/shadow /etc/shadow.org \
&& adduser --disabled-password --gecos '' user \
&& mkdir -p /usr/local/src /etc/dropbear /qwc2 /qwc2conf /run/secrets /home/user/.ssh /home/user/.cache /home/user/.config/yarn/global /root/.config \
&& touch /run/secrets/id_rsa /run/secrets/user-pw /home/user/.yarnrc /var/log/stdout+stderr.log \
&& echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > /home/user/.ssh/config \
&& chown -R user:user /usr/local/src /qwc2 /qwc2conf /home/user /run/secrets/id_rsa /run/secrets/user-pw /var/log/stdout+stderr.log \
&& chmod u=rwX,go= /home/user/.ssh \
&& chmod u=r,go= /run/secrets/id_rsa /run/secrets/user-pw /home/user/.ssh/config \
&& ln -s /run/secrets/id_rsa /home/user/.ssh/ \
&& ln -s /home/user/.config/yarn /root/.config/ \
&& ln -s /home/user/.yarnrc /root/ \
&& apt-get update -qq \
&& apt-get install -yq curl \
&& curl -sL https://deb.nodesource.com/setup_7.x | bash - \
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& ln -s /usr/local/bin/* /usr/bin \
&& ln -s /sbin/ldconfig /usr/bin \
&& ln -s /sbin/start-stop-daemon /usr/bin \
&& apt-get update -qq \
&& apt-get install -yq nano dropbear-bin git nodejs yarn \
&& rm -rf /var/lib/apt/lists/* \
VOLUME /qwc2 /qwc2conf /run/secrets
ENV USER=user
ENV SSH_PORT=22
ENV QWC2_GIT_REPOSITORY=https://github.com/qgis/qwc2-demo-app.git
ENV QWC2_GIT_BRANCH=master
ENV XDG_CONFIG_HOME=/home/user/.config
EXPOSE $SSH_PORT
CMD ["/bin/sh", "-c", "/usr/local/bin/entrypoint.sh"]