Merge pull request #284 from kensonman/alpine

Change the Docker base image from python:3-slim to python:3-alpine.
pull/301/head
Shengdun Hua 2022-05-29 10:58:57 +08:00 committed by GitHub
commit 4aec063197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
.git

View File

@ -1,11 +1,17 @@
FROM python:3.7-slim
FROM python:3-alpine
LABEL maintainer='<author>'
LABEL version='0.0.0-dev.0-build.0'
ADD . /code
WORKDIR /code
RUN \
groupadd -r webssh && \
useradd -r -s /bin/false -g webssh webssh && \
chown -R webssh:webssh /code && \
pip install -r requirements.txt
apk add --no-cache libc-dev libffi-dev gcc && \
pip install -r requirements.txt --no-cache-dir && \
apk del gcc libc-dev libffi-dev && \
addgroup webssh && \
adduser -Ss /bin/false -g webssh webssh && \
chown -R webssh:webssh /code
EXPOSE 8888/tcp
USER webssh