relay/Dockerfile

21 lines
589 B
Docker
Raw Permalink Normal View History

2024-04-01 21:29:27 +00:00
FROM python:3.12-alpine
2022-05-06 07:04:51 +00:00
# add env var to let the relay know it's in a container
ENV DOCKER_RUNNING=true
2022-05-06 07:04:51 +00:00
# setup various container properties
VOLUME ["/data"]
2024-04-02 16:32:49 +00:00
CMD ["python3", "-m", "relay", "run"]
2022-05-06 07:04:51 +00:00
EXPOSE 8080/tcp
WORKDIR /opt/activityrelay
# only copy necessary files
COPY relay ./relay
2024-04-01 21:29:27 +00:00
COPY pyproject.toml ./
# install and update important python modules
RUN pip3 install -U setuptools wheel pip
2022-05-06 07:04:51 +00:00
# install relay deps
2024-04-01 21:29:27 +00:00
RUN pip3 install `python3 -c "import tomllib; print(' '.join(dep.replace(' ', '') for dep in tomllib.load(open('pyproject.toml', 'rb'))['project']['dependencies']))"`