-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathDockerfile.build
More file actions
43 lines (36 loc) · 1.19 KB
/
Copy pathDockerfile.build
File metadata and controls
43 lines (36 loc) · 1.19 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
# syntax=docker/dockerfile:1.6
FROM node:20 AS base
ENV DEBIAN_FRONTEND=noninteractive
ENV VENV_DIR=/usr/src/app/.venv
ENV PATH="$VENV_DIR/bin:/root/.cargo/bin:$PATH"
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg ca-certificates curl bash nano \
python3 python3-venv \
&& rm -rf /var/lib/apt/lists/*
COPY package*.json tsconfig.json ./
RUN npm install -g npm@latest && npm ci --include=optional
COPY resources ./resources
COPY src ./src
COPY scripts ./scripts
COPY plugins ./plugins
# Install Python dependencies
RUN python3 -m venv "$VENV_DIR" && \
. "$VENV_DIR/bin/activate" && \
pip install --upgrade pip && \
pip install --index-url https://download.pytorch.org/whl/cpu \
torch==2.4.1 && \
pip install transformers==4.44.2 Flask==3.0.3 Pillow==10.4.0
# Install Rust (for tokenizers)
ENV CARGO_HOME=/usr/local/cargo \
RUSTUP_HOME=/usr/local/rustup
ENV PATH="${CARGO_HOME}/bin:${PATH}"
SHELL ["/bin/bash", "-lc"]
RUN set -eux; \
curl -fsSL https://sh.rustup.rs | sh -s -- -y --profile minimal; \
"${CARGO_HOME}/bin/rustc" -V; \
"${CARGO_HOME}/bin/cargo" -V
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]