-
-
Notifications
You must be signed in to change notification settings - Fork 92
/
Copy pathDockerfile
51 lines (38 loc) · 1.76 KB
/
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
45
46
47
48
49
50
51
FROM node:20 AS front-builder
WORKDIR /usr/src/tslib/storage
ADD ./tslib/storage/package.json /usr/src/tslib/storage/package.json
ADD ./tslib/storage/package-lock.json /usr/src/tslib/storage/package-lock.json
RUN npm install
WORKDIR /usr/src/tslib/types
ADD ./tslib/types/package.json /usr/src/tslib/types/package.json
ADD ./tslib/types/package-lock.json /usr/src/tslib/types/package-lock.json
RUN npm install
WORKDIR /usr/src/tslib/react
ADD ./tslib/react/package.json /usr/src/tslib/react/package.json
ADD ./tslib/react/package-lock.json /usr/src/tslib/react/package-lock.json
RUN npm install
WORKDIR /usr/src/optuna_dashboard
ADD ./optuna_dashboard/package.json /usr/src/optuna_dashboard/package.json
ADD ./optuna_dashboard/package-lock.json /usr/src/optuna_dashboard/package-lock.json
RUN npm install
WORKDIR /usr/src/
ADD ./tslib /usr/src/tslib
RUN make tslib
WORKDIR /usr/src/optuna_dashboard
ADD ./optuna_dashboard /usr/src/optuna_dashboard
RUN NODE_OPTIONS="--max-old-space-size=4096" npm run build:prd
FROM python:3.12-bookworm AS python-builder
WORKDIR /usr/src
RUN pip install --upgrade pip setuptools
RUN pip install --progress-bar off PyMySQL[rsa] psycopg2-binary gunicorn
ADD ./pyproject.toml /usr/src/pyproject.toml
ADD ./optuna_dashboard /usr/src/optuna_dashboard
COPY --from=front-builder /usr/src/optuna_dashboard/public/ /usr/src/optuna_dashboard/public/
RUN pip install --progress-bar off .
FROM python:3.12-slim-bookworm as runner
COPY --from=python-builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=python-builder /usr/local/bin/optuna-dashboard /usr/local/bin/optuna-dashboard
RUN mkdir /app
WORKDIR /app
EXPOSE 8080
ENTRYPOINT ["optuna-dashboard", "--port", "8080", "--host", "0.0.0.0", "--server", "gunicorn"]