Skip to content

Commit 6ab2588

Browse files
authored
Merge pull request #23 from jianxiaoguo/main
chore(dockerfile): change user and workdir
2 parents 13dedad + 94bcfdc commit 6ab2588

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

Dockerfile

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
FROM docker.io/drycc/base:bullseye
22

3+
RUN adduser --system \
4+
--shell /bin/bash \
5+
--disabled-password \
6+
--home /workspace \
7+
--group \
8+
drycc
9+
310
ENV PYTHON_VERSION=3.10.2
4-
COPY . /app
5-
WORKDIR /app
11+
COPY . /workspace
12+
WORKDIR /workspace
613

714
RUN export DEBIAN_FRONTEND=noninteractive \
815
&& install-stack python $PYTHON_VERSION && . init-stack \
9-
&& set -eux; pip3 install -r requirements.txt 2>/dev/null
16+
&& set -eux; pip3 install -r requirements.txt 2>/dev/null \
17+
&& rm -rf \
18+
/usr/share/doc \
19+
/usr/share/man \
20+
/usr/share/info \
21+
/usr/share/locale \
22+
/var/lib/apt/lists/* \
23+
/var/log/* \
24+
/var/cache/debconf/* \
25+
/etc/systemd \
26+
/lib/lsb \
27+
/lib/udev \
28+
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
29+
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
30+
&& mkdir -p /usr/share/man/man{1..8} \
31+
&& chown -R drycc:drycc /workspace
1032

33+
USER drycc
1134
EXPOSE 8000
1235
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]

0 commit comments

Comments
 (0)