-
Notifications
You must be signed in to change notification settings - Fork 487
/
dockerfile
44 lines (31 loc) · 996 Bytes
/
dockerfile
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
# ==== FRONTEND ====
FROM node:19-alpine AS builder
WORKDIR /frontend
# Copy the package.json and install dependencies
COPY app/package*.json ./
RUN npm install
# Copy rest of the files
COPY app/src ./src/
COPY app/* ./
# Build the project
RUN npx parcel build src/index.html --no-cache --no-source-maps
# ==== BACKEND ====
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime
WORKDIR /web/
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV XDG_CONFIG_HOME=/web/config
ARG POETRY_VERSION=1.4.1
RUN pip install --no-cache-dir --upgrade pip
# install poetry
RUN pip install poetry==${POETRY_VERSION}
RUN poetry config virtualenvs.create false
COPY server/ ./server/
COPY README.md .
COPY --from=builder /frontend/dist ./server/static/
# install python dependencies
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install --without=dev --no-interaction --no-ansi
ENTRYPOINT ["openplayground", "run", "--host", "0.0.0.0", "--env", "/web/config/.env"]