mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-08-21 14:37:16 +00:00
31 lines
823 B
Docker
31 lines
823 B
Docker
FROM python:3-alpine
|
|
|
|
# Build arguments
|
|
ARG GIT_COMMIT="development"
|
|
ARG GIT_COMMIT_SHORT="dev"
|
|
ARG BUILD_DATE="unknown"
|
|
ARG BRANCH_NAME="unknown"
|
|
|
|
# Environment variables from build args
|
|
ENV GIT_COMMIT=${GIT_COMMIT}
|
|
ENV GIT_COMMIT_SHORT=${GIT_COMMIT_SHORT}
|
|
ENV BUILD_DATE=${BUILD_DATE}
|
|
ENV BRANCH_NAME=${BRANCH_NAME}
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies first (this layer will be cached)
|
|
RUN apk update && apk add git
|
|
|
|
# Copy and install Python dependencies (this layer will be cached when requirements.txt doesn't change)
|
|
COPY ./requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code (this layer will change frequently)
|
|
COPY . .
|
|
|
|
# Run collectstatic
|
|
RUN python manage.py collectstatic --noinput
|
|
|
|
CMD [ "python", "./manage.py", "runserver", "0.0.0.0:8000" ]
|