Initial commit
This commit is contained in:
29
skills/uv/assets/docker_examples/Dockerfile.simple
Normal file
29
skills/uv/assets/docker_examples/Dockerfile.simple
Normal file
@@ -0,0 +1,29 @@
|
||||
# Simple Docker build with uv
|
||||
# Single-stage build for development or simpler deployments
|
||||
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Install uv
|
||||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy all files
|
||||
COPY . .
|
||||
|
||||
# Create virtual environment and install dependencies
|
||||
RUN uv venv /opt/venv && \
|
||||
. /opt/venv/bin/activate && \
|
||||
uv sync --frozen --no-dev
|
||||
|
||||
# Set environment to use virtual environment
|
||||
ENV VIRTUAL_ENV=/opt/venv \
|
||||
PATH="/opt/venv/bin:$PATH" \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Run application
|
||||
CMD ["python", "-m", "myapp"]
|
||||
Reference in New Issue
Block a user