-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
32 lines (26 loc) · 1.08 KB
/
Dockerfile
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
26
27
28
29
30
31
32
# Multi-stage Dockerfile, to build and package an extraction plugin
# Recommended way to build the plugin is by calling tox:
# tox -e package
# if you need to pass a proxy:
# tox -e package -- --build-arg https_proxy=https://your-proxy
# if you want to pass a private Python package index:
# tox -e package -- --build-arg PIP_INDEX_URL=https://your-pypi-mirror
###############################################################################
# Stage 1: build the plugin
# use a 'fat' image to setup the dependencies we'll need
FROM python:3.13 AS builder
ARG PIP_INDEX_URL=https://pypi.org/simple/
RUN python -m venv /venv
ENV PATH="/venv/bin:$PATH"
COPY requirements.txt /requirements.txt
RUN pip install -Ur /requirements.txt
###############################################################################
# Stage 2: create the distributable plugin image
# use a 'slim' image for running the actual plugin
FROM python:3.13-slim
COPY --from=builder /venv /venv
ENV PATH="/venv/bin:$PATH"
COPY plugin.py /app/
EXPOSE 8999
ENTRYPOINT ["serve_plugin", "-v"]
CMD ["/app/plugin.py", "8999"]