Fix: Dependency update for Docker image
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 2m51s
All checks were successful
Docker Build and Push (Multi-architecture) / build-and-push (push) Successful in 2m51s
This commit is contained in:
11
dockerfile
11
dockerfile
@@ -18,12 +18,15 @@ COPY requirements.txt .
|
|||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
pip install --no-cache-dir -r requirements.txt
|
pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
# Final stage - using smaller base image
|
# Final stage - using Alpine with build dependencies
|
||||||
FROM python:3.11-alpine3.18
|
FROM python:3.11-alpine3.18
|
||||||
|
|
||||||
# Install minimal runtime dependencies
|
# Install runtime and build dependencies
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
tini \
|
tini \
|
||||||
|
build-base \
|
||||||
|
python3-dev \
|
||||||
|
openblas-dev \
|
||||||
&& rm -rf /var/cache/apk/*
|
&& rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
@@ -33,13 +36,15 @@ WORKDIR /app
|
|||||||
COPY --from=builder /opt/venv /opt/venv
|
COPY --from=builder /opt/venv /opt/venv
|
||||||
ENV PATH="/opt/venv/bin:$PATH"
|
ENV PATH="/opt/venv/bin:$PATH"
|
||||||
|
|
||||||
|
# Reinstall numpy to ensure Alpine compatibility
|
||||||
|
RUN pip install --no-cache-dir --force-reinstall numpy
|
||||||
|
|
||||||
# Create a non-root user
|
# Create a non-root user
|
||||||
RUN addgroup -S bot && adduser -S bot -G bot
|
RUN addgroup -S bot && adduser -S bot -G bot
|
||||||
|
|
||||||
# Copy necessary files
|
# Copy necessary files
|
||||||
COPY --chown=bot:bot *.py ./
|
COPY --chown=bot:bot *.py ./
|
||||||
COPY --chown=bot:bot entrypoint.sh ./
|
COPY --chown=bot:bot entrypoint.sh ./
|
||||||
# Add other necessary directories/files as needed
|
|
||||||
|
|
||||||
# Create directories for persistent storage
|
# Create directories for persistent storage
|
||||||
RUN mkdir -p logs embed && \
|
RUN mkdir -p logs embed && \
|
||||||
|
|||||||
Reference in New Issue
Block a user