blob: 0629e3735189e15257dcd5cad0f4691404990258 (
plain)
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
|
FROM debian:latest
ARG USER=crupest
ARG IN_CHINA=
ENV CRUPEST_DEBIAN_DEV_USER=${USER}
ENV CRUPEST_DEBIAN_DEV_IN_CHINA=${IN_CHINA}
ADD bootstrap /bootstrap
RUN /bootstrap/setup.bash
ENV LANG=en_US.utf8
USER ${USER}
WORKDIR /home/${USER}
RUN --mount=type=secret,id=code-server-password,required=true,env=CRUPEST_CODE_SERVER_PASSWORD \
mkdir -p ${HOME}/.config/code-server && \
echo -e "auth: password\nhashed-password: " >> ${HOME}/.config/code-server/config.yaml && \
echo -n "$CRUPEST_CODE_SERVER_PASSWORD" | argon2 $(shuf -i 10000000-99999999 -n 1 --random-source /dev/urandom) -e >> ${HOME}/.config/code-server/config.yaml
EXPOSE 4567
VOLUME [ "/home/${USER}" ]
ENTRYPOINT ["tini", "--"]
CMD [ "/usr/bin/code-server", "--bind-addr", "0.0.0.0:4567" ]
|