-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (41 loc) · 1.37 KB
/
Dockerfile
File metadata and controls
61 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# syntax = docker/dockerfile:1
# Stage 1: Build frontend (Next.js)
FROM node:25-slim AS frontend-builder
WORKDIR /workspace/webapp
# Copy package files
COPY webapp/package.json webapp/package-lock.json ./
# Install dependencies
RUN npm ci
# Copy frontend source
COPY webapp/ .
# Build frontend to static export (configured in next.config.ts)
RUN npm run build
# Stage 2: Build API
FROM python:3.14-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates default-jre \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN pip install --no-cache-dir poetry
# Use the system Python (don't create virtualenv)
RUN poetry config virtualenvs.create false
# Copy API project files
COPY api/pyproject.toml api/poetry.lock api/README.md ./
# Install Python dependencies
RUN poetry install --no-interaction --no-ansi --no-root
# Copy API source code
COPY api/ .
# Install the package
RUN poetry install --no-interaction --no-ansi
# Copy frontend static assets from build stage
COPY --from=frontend-builder /workspace/webapp/out ./out
# Configure git
RUN git config --system --add safe.directory '*'
# Expose port for FastAPI
EXPOSE 8000
# Default command (can be overridden)
CMD ["poetry", "run", "smm-rest", "--host", "0.0.0.0", "--port", "8000"]