-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (37 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (37 loc) · 1.12 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
# syntax=docker/dockerfile:1
FROM python:3.13-slim-bookworm
RUN sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list.d/debian.sources
# Install Node.js 20 + build tools
RUN apt-get update && apt-get install -y \
curl gnupg build-essential \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Create isolated Python env
RUN python -m venv /opt/venv
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="/opt/venv/bin:${PATH}"
WORKDIR /app
ENV PORT=8080
# Copy manifests first for caching
COPY package*.json pnpm-lock.yaml ./
COPY requirements.txt ./
COPY components.json next.config.mjs postcss.config.mjs tsconfig.json ./
# Install JS + Python deps
RUN npm ci || npm install
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy app sources
COPY app ./app
COPY components ./components
COPY hooks ./hooks
COPY lib ./lib
COPY scripts ./scripts
COPY styles ./styles
COPY types ./types
COPY .env .
# COPY public ./public
# Build app
RUN npm run build
EXPOSE 8080
CMD ["sh", "-c", "npm run start -- -p ${PORT}"]