From fbffbe27c8ad20e299b5e854363d93545fd28bd8 Mon Sep 17 00:00:00 2001 From: thevahidal Date: Tue, 7 Jan 2025 17:20:35 +0330 Subject: [PATCH] Fix Dockerfile to serve Jake via nginx --- Dockerfile | 14 +++++++++----- nginx.conf | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 nginx.conf diff --git a/Dockerfile b/Dockerfile index f3d87c3..6db489f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM python:3.11-slim WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends curl git \ - && curl -sSL https://install.python-poetry.org | python3 - \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && curl -sSL https://install.python-poetry.org | python3 - \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* ENV PATH="/root/.local/bin:$PATH" @@ -15,6 +15,10 @@ RUN poetry install --no-root RUN poetry run python script.py -VOLUME ["/app/dist"] +RUN apt-get update && apt-get install -y --no-install-recommends nginx \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* -CMD ["tail", "-f", "/dev/null"] +COPY nginx.conf /etc/nginx/nginx.conf + +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..d545c63 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +events { } + +http { + include /etc/nginx/mime.types; + + server { + listen 80; + server_name localhost; + + location / { + root /app/dist; + index index.html; + } + } +}