aboutsummaryrefslogtreecommitdiff
path: root/docker/debian-dev/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'docker/debian-dev/Dockerfile')
-rw-r--r--docker/debian-dev/Dockerfile18
1 files changed, 11 insertions, 7 deletions
diff --git a/docker/debian-dev/Dockerfile b/docker/debian-dev/Dockerfile
index 95f0602..0629e37 100644
--- a/docker/debian-dev/Dockerfile
+++ b/docker/debian-dev/Dockerfile
@@ -2,20 +2,24 @@ FROM debian:latest
ARG USER=crupest
ARG IN_CHINA=
-ARG CODE_SERVER=true
ENV CRUPEST_DEBIAN_DEV_USER=${USER}
ENV CRUPEST_DEBIAN_DEV_IN_CHINA=${IN_CHINA}
-ENV CRUPEST_DEBIAN_DEV_SETUP_CODE_SERVER=${CODE_SERVER}
ADD bootstrap /bootstrap
-
RUN /bootstrap/setup.bash
-ENV LANG=en_US.utf8
+ENV LANG=en_US.utf8
USER ${USER}
WORKDIR /home/${USER}
-EXPOSE 8080
-VOLUME [ "/data", "/home/${USER}" ]
-CMD [ "bash", "-l" ]
+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" ]