Skip to content

Commit 7990df1

Browse files
committed
Fix this
1 parent 173de56 commit 7990df1

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

Resources/docker/app/Dockerfile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM python:3.13.7-alpine AS builder
22

33
ENV PYTHONUNBUFFERED=1
4-
ENV DJANGO_SETTINGS_MODULE='config.docker-compose'
54

65
RUN mkdir /code
76
WORKDIR /code
@@ -22,11 +21,31 @@ RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \
2221
postgresql-dev binutils rust cargo && \
2322
uv sync --frozen
2423

24+
FROM python:3.13.7-alpine
25+
26+
ENV PYTHONUNBUFFERED=1
27+
ENV DJANGO_SETTINGS_MODULE='config.docker-compose'
28+
29+
RUN mkdir /code
30+
WORKDIR /code
31+
32+
# Copy UV and virtual environment from builder
33+
COPY --from=builder /root/.local /root/.local
34+
COPY --from=builder /code/.venv /code/.venv
35+
36+
# Add UV to PATH
37+
ENV PATH="/root/.local/bin:$PATH"
38+
39+
# Install runtime dependencies
40+
RUN apk add --no-cache postgresql-libs libstdc++
41+
42+
# Copy application code
43+
ADD . /code/
44+
2545
RUN addgroup -g 1000 -S pokeapi && \
2646
adduser -u 1000 -S pokeapi -G pokeapi
2747
USER pokeapi
2848

29-
3049
CMD ["uv", "run", "gunicorn", "config.wsgi:application", "-c", "gunicorn.conf.py"]
3150

3251
EXPOSE 80

0 commit comments

Comments
 (0)