Skip to content

Commit 25bdfae

Browse files
authored
feat: allow user-defined port via PORT environment variable in Dockerfile
1 parent 6d65706 commit 25bdfae

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ FROM python:3.11-slim AS builder
1111
ENV PYTHONDONTWRITEBYTECODE 1
1212
ENV PYTHONUNBUFFERED 0
1313
ENV DockerHOME=/home/rsstranslator
14+
ENV PORT=8000
1415
RUN mkdir -p $DockerHOME/data
1516
WORKDIR $DockerHOME
1617
COPY . $DockerHOME
@@ -22,5 +23,5 @@ RUN pip install -r requirements/dev.txt --no-cache-dir -U && \
2223
find $DockerHOME -type d -name "__pycache__" -exec rm -r {} + && \
2324
rm -rf $DockerHOME/.cache/pip
2425
HEALTHCHECK --interval=10s --timeout=5s --retries=3 --start-period=20s CMD pgrep -f "python manage.py run_huey" || exit 1
25-
EXPOSE 8000
26-
CMD python manage.py init_server && python manage.py run_huey -f & uvicorn config.asgi:application --host 0.0.0.0
26+
EXPOSE ${PORT}
27+
CMD python manage.py init_server && python manage.py run_huey -f & uvicorn config.asgi:application --host 0.0.0.0 --port ${PORT}

0 commit comments

Comments
 (0)