mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-11 12:30:25 +08:00
Add Dockerfile
This commit is contained in:
@@ -29,6 +29,19 @@ $ npm run build:prd
|
||||
|
||||
</details>
|
||||
|
||||
### Building a Docker image
|
||||
|
||||
```
|
||||
$ docker build -t <IMAGE_NAME> .
|
||||
```
|
||||
|
||||
When failed above command due to the out of heap memory error (Exit code: 137), please check "Resources" tab on your Docker engine's preference since it requires a lot of memory to compile TypeScript files.
|
||||
You can use the Docker image like below:
|
||||
|
||||
```
|
||||
$ docker run -it --rm -p 8080:8080 <IMAGE_NAME> sqlite:///db.sqlite3
|
||||
```
|
||||
|
||||
### Running dashboard server
|
||||
|
||||
```
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
FROM node:14 AS front-builder
|
||||
WORKDIR /usr/src
|
||||
|
||||
ADD ./package.json /usr/src/package.json
|
||||
ADD ./package-lock.json /usr/src/package-lock.json
|
||||
RUN npm install
|
||||
|
||||
ADD ./tsconfig.json /usr/src/tsconfig.json
|
||||
ADD ./webpack.config.js /usr/src/webpack.config.js
|
||||
ADD ./optuna_dashboard/static/ /usr/src/optuna_dashboard/static
|
||||
RUN mkdir -p /usr/src/optuna_dashboard/public
|
||||
RUN npm run build:prd
|
||||
|
||||
FROM python:3.8
|
||||
|
||||
WORKDIR /usr/src
|
||||
RUN pip install --upgrade pip setuptools
|
||||
RUN pip install --no-cache-dir --progress-bar off PyMySQL cryptography psycopg2-binary
|
||||
|
||||
ADD ./setup.cfg /usr/src/setup.cfg
|
||||
ADD ./setup.py /usr/src/setup.py
|
||||
ADD ./optuna_dashboard /usr/src/optuna_dashboard
|
||||
COPY --from=front-builder /usr/src/optuna_dashboard/public/ /usr/src/optuna_dashboard/public/
|
||||
RUN pip install --no-cache-dir --progress-bar off .
|
||||
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["optuna-dashboard", "--port", "8080", "--host", "0.0.0.0"]
|
||||
Reference in New Issue
Block a user