Files
OutFleet/Dockerfile

41 lines
1.3 KiB
Docker
Raw Permalink Normal View History

2025-03-17 15:09:36 +02:00
FROM python:3-alpine
2023-09-25 23:48:25 +03:00
# 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}
2023-09-25 23:48:25 +03:00
WORKDIR /app
2025-07-21 17:20:08 +03:00
# Install system dependencies first (this layer will be cached)
2025-08-05 01:23:07 +03:00
RUN apk update && apk add git curl unzip
2025-07-21 17:20:08 +03:00
# Copy and install Python dependencies (this layer will be cached when requirements.txt doesn't change)
2025-03-13 01:43:33 +02:00
COPY ./requirements.txt .
2025-07-21 17:20:08 +03:00
RUN pip install --no-cache-dir -r requirements.txt
2025-08-05 01:23:07 +03:00
# Install Xray-core
RUN XRAY_VERSION=$(curl -s https://api.github.com/repos/XTLS/Xray-core/releases/latest | sed -n 's/.*"tag_name": "\([^"]*\)".*/\1/p') && \
curl -L -o /tmp/xray.zip "https://github.com/XTLS/Xray-core/releases/download/${XRAY_VERSION}/Xray-linux-64.zip" && \
cd /tmp && unzip xray.zip && \
ls -la /tmp/ && \
find /tmp -name "xray" -type f && \
cp xray /usr/local/bin/xray && \
chmod +x /usr/local/bin/xray && \
rm -rf /tmp/xray.zip /tmp/xray
2025-07-21 17:20:08 +03:00
# Copy the rest of the application code (this layer will change frequently)
2025-03-13 01:43:33 +02:00
COPY . .
2025-07-21 17:20:08 +03:00
# Run collectstatic
2024-10-20 22:43:31 +00:00
RUN python manage.py collectstatic --noinput
2023-09-25 23:48:25 +03:00
2024-10-20 21:57:12 +00:00
CMD [ "python", "./manage.py", "runserver", "0.0.0.0:8000" ]