/
Lepecin
/
todo-app
Обзор
Документация
Войти
/
Lepecin
/
todo-app
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
dockerfile
38 строк
1 KB
Lepecin
Initialise todo app project
30 июл 2025, 12:02
30 июл 2025, 12:02
f0f5970
Код
Авторство
О чём код?
# Stage 1: Build frontend (TypeScript to JavaScript) FROM node:20-alpine AS frontend-builder WORKDIR /build # Copy package.json and lock file from root COPY package.json package-lock.json ./ RUN npm ci # For reproducible installs from lock file # Copy tsconfig.json from root COPY tsconfig.json ./ # Copy TypeScript sources COPY src/db_test/source ./src/db_test/source # Run the build command; adjust if your build script is different (e.g., "tsc" or "npm run build") RUN npx tsc # This should output to src/db_test/static based on tsconfig.json # Stage 2: Build Python backend FROM ghcr.io/astral-sh/uv:python3.12-bookworm WORKDIR /app # Copy Python dependencies COPY pyproject.toml ./pyproject.toml COPY uv.lock ./uv.lock # Install Python deps (no dev) RUN uv sync --no-dev # Copy Python sources (including the source dir with TS, but static will be overlaid with compiled JS) COPY src ./src # Copy compiled static files from Stage 1 COPY --from=frontend-builder /build/src/db_test/static ./src/db_test/static # Entry point remains the same ENTRYPOINT ["uv", "run", "--no-dev", "-m", "src.db_test"]