Files

18 lines
887 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# VDE 外部服务模板:Python 镜像。
#
# 构建(上下文必须是 plugins/external/templates):
# docker build -f plugins/external/templates/container/Dockerfile.python \
# -t vde/external-service-template-python:0.1 plugins/external/templates
#
# ENTRYPOINT 为 python3,因此宿主传入的容器内入口是 /opt/vde/vde_service_echo.py:
# docker run --rm --network none --read-only --tmpfs /tmp \
# --volume <workdir>:/vde/work vde/external-service-template-python:0.1 \
# /opt/vde/vde_service_echo.py --request /vde/work/request.json --response /vde/work/response.json
FROM python:3.12-slim-bookworm
RUN useradd --system --uid 10001 --create-home --home-dir /home/vde vde
COPY python_service/vde_service_echo.py /opt/vde/vde_service_echo.py
RUN chmod 0555 /opt/vde/vde_service_echo.py
USER 10001
WORKDIR /vde/work
ENTRYPOINT ["python3", "-I"]