mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-11 20:06:13 +02:00
Compare commits
1 Commits
thin-docker
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 70cb133b24 |
+13
-22
@@ -9,35 +9,26 @@ COPY frontend/package.json frontend/package-lock.json frontend/.npmrc ./
|
|||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
COPY frontend/ ./
|
COPY frontend/ ./
|
||||||
RUN VITE_COMMIT_HASH=${COMMIT_HASH} npm run build \
|
RUN VITE_COMMIT_HASH=${COMMIT_HASH} npm run build
|
||||||
&& find dist -name '*.map' -delete
|
|
||||||
|
|
||||||
|
|
||||||
# Stage 2: Install Python dependencies (uv stays in this stage only)
|
# Stage 2: Python runtime
|
||||||
FROM python:3.13-slim AS python-deps
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=ghcr.io/astral-sh/uv:0.6 /uv /usr/local/bin/uv
|
|
||||||
COPY pyproject.toml uv.lock ./
|
|
||||||
RUN uv sync --frozen --no-dev
|
|
||||||
|
|
||||||
|
|
||||||
# Stage 3: Final runtime (no uv, no source maps)
|
|
||||||
FROM python:3.13-slim
|
FROM python:3.13-slim
|
||||||
|
|
||||||
ARG COMMIT_HASH=unknown
|
ARG COMMIT_HASH=unknown
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV COMMIT_HASH=${COMMIT_HASH} \
|
ENV COMMIT_HASH=${COMMIT_HASH}
|
||||||
PATH="/app/.venv/bin:$PATH"
|
|
||||||
|
|
||||||
# Copy installed venv from deps stage
|
# Install uv
|
||||||
COPY --from=python-deps /app/.venv ./.venv
|
COPY --from=ghcr.io/astral-sh/uv:0.6 /uv /usr/local/bin/uv
|
||||||
|
|
||||||
# Copy dependency metadata (pyproject.toml needed by app for version info)
|
# Copy dependency files first for layer caching
|
||||||
COPY pyproject.toml ./
|
COPY pyproject.toml uv.lock ./
|
||||||
|
|
||||||
|
# Install dependencies (no dev/test deps)
|
||||||
|
RUN uv sync --frozen --no-dev
|
||||||
|
|
||||||
# Copy application code
|
# Copy application code
|
||||||
COPY app/ ./app/
|
COPY app/ ./app/
|
||||||
@@ -45,7 +36,7 @@ COPY app/ ./app/
|
|||||||
# Copy license attributions
|
# Copy license attributions
|
||||||
COPY LICENSES.md ./
|
COPY LICENSES.md ./
|
||||||
|
|
||||||
# Copy built frontend from first stage (source maps already stripped)
|
# Copy built frontend from first stage
|
||||||
COPY --from=frontend-builder /build/dist ./frontend/dist
|
COPY --from=frontend-builder /build/dist ./frontend/dist
|
||||||
|
|
||||||
# Create data directory for SQLite database
|
# Create data directory for SQLite database
|
||||||
@@ -53,5 +44,5 @@ RUN mkdir -p /app/data
|
|||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
# Run uvicorn directly from the venv (no uv needed at runtime)
|
# Run the application (we retain root for max compatibility)
|
||||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||||
|
|||||||
@@ -147,7 +147,9 @@ describe('buildRawPacketStatsSnapshot', () => {
|
|||||||
'2-5',
|
'2-5',
|
||||||
'6-10',
|
'6-10',
|
||||||
'11-15',
|
'11-15',
|
||||||
'16+',
|
'16-20',
|
||||||
|
'21-31',
|
||||||
|
'32+',
|
||||||
]);
|
]);
|
||||||
expect(stats.hopProfile).toEqual(
|
expect(stats.hopProfile).toEqual(
|
||||||
expect.arrayContaining([
|
expect.arrayContaining([
|
||||||
@@ -156,7 +158,9 @@ describe('buildRawPacketStatsSnapshot', () => {
|
|||||||
expect.objectContaining({ label: '2-5', count: 1 }),
|
expect.objectContaining({ label: '2-5', count: 1 }),
|
||||||
expect.objectContaining({ label: '6-10', count: 0 }),
|
expect.objectContaining({ label: '6-10', count: 0 }),
|
||||||
expect.objectContaining({ label: '11-15', count: 0 }),
|
expect.objectContaining({ label: '11-15', count: 0 }),
|
||||||
expect.objectContaining({ label: '16+', count: 0 }),
|
expect.objectContaining({ label: '16-20', count: 0 }),
|
||||||
|
expect.objectContaining({ label: '21-31', count: 0 }),
|
||||||
|
expect.objectContaining({ label: '32+', count: 0 }),
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
expect(stats.hopByteWidthProfile).toEqual(
|
expect(stats.hopByteWidthProfile).toEqual(
|
||||||
|
|||||||
@@ -322,7 +322,13 @@ function getHopProfileBucket(pathTokenCount: number): string {
|
|||||||
if (pathTokenCount <= 15) {
|
if (pathTokenCount <= 15) {
|
||||||
return '11-15';
|
return '11-15';
|
||||||
}
|
}
|
||||||
return '16+';
|
if (pathTokenCount <= 20) {
|
||||||
|
return '16-20';
|
||||||
|
}
|
||||||
|
if (pathTokenCount <= 31) {
|
||||||
|
return '21-31';
|
||||||
|
}
|
||||||
|
return '32+';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildRawPacketStatsSnapshot(
|
export function buildRawPacketStatsSnapshot(
|
||||||
@@ -354,7 +360,9 @@ export function buildRawPacketStatsSnapshot(
|
|||||||
['2-5', 0],
|
['2-5', 0],
|
||||||
['6-10', 0],
|
['6-10', 0],
|
||||||
['11-15', 0],
|
['11-15', 0],
|
||||||
['16+', 0],
|
['16-20', 0],
|
||||||
|
['21-31', 0],
|
||||||
|
['32+', 0],
|
||||||
]);
|
]);
|
||||||
const hopByteWidthCounts = new Map<string, number>([
|
const hopByteWidthCounts = new Map<string, number>([
|
||||||
['No path', 0],
|
['No path', 0],
|
||||||
|
|||||||
Reference in New Issue
Block a user