Skip to content

Commit

Permalink
Merge pull request #9 from thevahidal/fix-dockerfile-add-nginx
Browse files Browse the repository at this point in the history
Fix Dockerfile to serve Jake via nginx
  • Loading branch information
thevahidal authored Jan 7, 2025
2 parents 0dbf249 + fbffbe2 commit d08892f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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;"]
15 changes: 15 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
events { }

http {
include /etc/nginx/mime.types;

server {
listen 80;
server_name localhost;

location / {
root /app/dist;
index index.html;
}
}
}

0 comments on commit d08892f

Please sign in to comment.