Fixed uvicorn not found in PATH issue
Browse files- Dockerfile +6 -7
Dockerfile
CHANGED
|
@@ -11,27 +11,26 @@ RUN npm run build
|
|
| 11 |
# Use Python image with uv pre-installed and nginx
|
| 12 |
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
| 13 |
|
| 14 |
-
# Install nginx
|
| 15 |
RUN apt-get update && apt-get install -y nginx
|
| 16 |
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
-
# Copy backend code
|
| 20 |
-
COPY backend/ backend/
|
| 21 |
-
COPY pyproject.toml .
|
| 22 |
|
| 23 |
# Install backend dependencies and make pytest available
|
|
|
|
|
|
|
| 24 |
RUN uv sync && uv pip install .
|
| 25 |
ENV PATH="/root/.local/bin:/root/.uv/venv/bin:${PATH}"
|
| 26 |
|
| 27 |
-
#
|
| 28 |
COPY --from=frontend-builder /app/frontend/build /usr/share/nginx/html
|
| 29 |
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
| 30 |
|
| 31 |
-
#
|
|
|
|
|
|
|
| 32 |
EXPOSE 80 8000
|
| 33 |
|
| 34 |
-
# Create startup script
|
| 35 |
COPY start.sh /start.sh
|
| 36 |
RUN chmod +x /start.sh
|
| 37 |
|
|
|
|
| 11 |
# Use Python image with uv pre-installed and nginx
|
| 12 |
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
| 13 |
|
|
|
|
| 14 |
RUN apt-get update && apt-get install -y nginx
|
| 15 |
|
| 16 |
WORKDIR /app
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Install backend dependencies and make pytest available
|
| 20 |
+
COPY backend/ backend/
|
| 21 |
+
COPY pyproject.toml .
|
| 22 |
RUN uv sync && uv pip install .
|
| 23 |
ENV PATH="/root/.local/bin:/root/.uv/venv/bin:${PATH}"
|
| 24 |
|
| 25 |
+
# Set up frontend
|
| 26 |
COPY --from=frontend-builder /app/frontend/build /usr/share/nginx/html
|
| 27 |
COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
|
| 28 |
|
| 29 |
+
# Add uv's bin directory to PATH
|
| 30 |
+
ENV PATH="/app/.venv/bin:/root/.local/bin:/root/.uv/venv/bin:${PATH}"
|
| 31 |
+
|
| 32 |
EXPOSE 80 8000
|
| 33 |
|
|
|
|
| 34 |
COPY start.sh /start.sh
|
| 35 |
RUN chmod +x /start.sh
|
| 36 |
|