mirror of
https://github.com/BigBodyCobain/Shadowbroker.git
synced 2026-08-01 17:51:49 +02:00
Update dockerfile to use UV
Change backend context from . to ./backend in docker-compose. This is necessary for copying the pyproject.toml and uv.lock files from project root level
This commit is contained in:
+17
-7
@@ -9,19 +9,29 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& apt-get install -y --no-install-recommends nodejs \
|
&& apt-get install -y --no-install-recommends nodejs \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install UV for Python dependency management
|
||||||
COPY requirements.txt .
|
ADD https://astral.sh/uv/install.sh /uv-installer.sh
|
||||||
RUN pip install --no-cache-dir -r requirements.txt \
|
RUN sh /uv-installer.sh && rm /uv-installer.sh
|
||||||
&& playwright install --with-deps chromium
|
ENV PATH="/root/.local/bin/:$PATH"
|
||||||
|
# Set environment variable for UV to install dependencies in the system Python environment
|
||||||
|
# By default UV creates a new venv and installs dependencies there
|
||||||
|
ENV UV_PROJECT_ENVIRONMENT=/usr/local
|
||||||
|
|
||||||
|
# Copy pyproject.toml from root for dependency management
|
||||||
|
COPY pyproject.toml .
|
||||||
|
# Copy lock file for reproducible builds
|
||||||
|
COPY uv.lock .
|
||||||
|
# Install Python dependencies using UV (this will use the lock file for reproducibility)
|
||||||
|
RUN uv sync --frozen
|
||||||
|
RUN uv run playwright install --with-deps chromium
|
||||||
|
|
||||||
# Install Node.js dependencies (ws module for AIS WebSocket proxy)
|
# Install Node.js dependencies (ws module for AIS WebSocket proxy)
|
||||||
# Copy manifests first so this layer is cached unless deps change
|
# Copy manifests first so this layer is cached unless deps change
|
||||||
COPY package*.json ./
|
COPY backend/package*.json ./
|
||||||
RUN npm ci --omit=dev
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY . .
|
COPY backend/ .
|
||||||
|
|
||||||
# Create a non-root user for security
|
# Create a non-root user for security
|
||||||
# Grant write access to /app so the auto-updater can extract files
|
# Grant write access to /app so the auto-updater can extract files
|
||||||
RUN adduser --system --uid 1001 backenduser \
|
RUN adduser --system --uid 1001 backenduser \
|
||||||
|
|||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: .
|
||||||
|
dockerfile: ./backend/Dockerfile
|
||||||
container_name: shadowbroker-backend
|
container_name: shadowbroker-backend
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|||||||
Reference in New Issue
Block a user