39 lines
967 B
Docker
39 lines
967 B
Docker
FROM node:20-slim AS frontend-build
|
|
WORKDIR /app/frontend
|
|
# Correct path relative to build context (root)
|
|
COPY content-engine/frontend/package*.json ./
|
|
RUN npm install
|
|
COPY content-engine/frontend/ ./
|
|
RUN npm run build
|
|
|
|
FROM python:3.11-slim
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
gnupg \
|
|
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies
|
|
COPY content-engine/requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Install Backend Node dependencies
|
|
COPY content-engine/package.json ./
|
|
RUN npm install
|
|
|
|
# Copy backend files
|
|
COPY content-engine/*.py ./
|
|
COPY content-engine/server.cjs ./
|
|
# Helpers and Config from root
|
|
COPY helpers.py ./
|
|
COPY config.py ./
|
|
|
|
# Copy built frontend
|
|
COPY --from=frontend-build /app/frontend/dist ./dist
|
|
|
|
EXPOSE 3006
|
|
CMD ["node", "server.cjs"] |