-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (23 loc) · 970 Bytes
/
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
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.13
FROM python:${PYTHON_VERSION}-slim AS base
LABEL org.opencontainers.image.authors="[email protected]"
LABEL org.opencontainers.image.url="https://github.com/chschnell/wsnic"
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1
# Set the installation and working directory in the Docker file system.
WORKDIR /opt/wsnic
# Install required apt packages.
RUN apt-get update && \
apt-get install -y --no-install-recommends iproute2 iptables dnsmasq stunnel iperf && \
apt-get clean
# Copy Python source code into the container.
COPY wsnic/*.py ./wsnic/
COPY README.md LICENSE .
# Expose the ports that the application listens on.
EXPOSE 8086 8087
# Run the application.
ENTRYPOINT ["python", "-m", "wsnic"]