Skip to content

Commit c571f6a

Browse files
committed
Docker version ploting
1 parent 0087d9b commit c571f6a

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Dockerfile

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@
33
# sudo docker build -t material_xs_plotter .
44

55
# run with
6-
# docker run material_xs_plotter
6+
# docker run --network host -t material_xs_plotter
77

88

9-
# build with the following command
10-
# sudo docker build -f Dockerfile_openmc -t openmcworkshop/openmc
119

1210
FROM ghcr.io/openmc-data-storage/nuclear_data_base_docker:h5_base
1311

1412

15-
# RUN pip3 install streamlit
16-
# RUN pip3 install plotly
17-
1813
COPY requirements.txt .
1914
RUN pip install -r requirements.txt
2015

16+
RUN pip install gunicorn==20.0.4
2117

22-
ENV OPENMC_CROSS_SECTIONS=/tendl-2019-hdf5/cross_sections.xml
18+
ENV OPENMC_CROSS_SECTIONS=/TENDL-2019/cross_sections.xml
19+
# COPY assets assets
20+
COPY options.py .
2321
COPY app.py .
2422

23+
ENV PORT 8080
24+
2525
EXPOSE 8080
2626

27-
ENTRYPOINT ["python", "app.py"]
27+
# Run the web service on container startup. Here we use the gunicorn
28+
# webserver, with one worker process and 8 threads.
29+
# For environments with multiple CPU cores, increase the number of workers
30+
# to be equal to the cores available.
31+
# Timeout is set to 0 to disable the timeouts of the workers to allow Cloud Run
32+
# to handle instance scaling. For more details see
33+
# https://cloud.google.com/run/docs/quickstarts/build-and-deploy/python
34+
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 app:server

app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
app = dash.Dash(__name__)
1313

14+
15+
server = app.server
16+
17+
1418
app.layout = html.Div([
1519
html.Div([
1620
dcc.Dropdown(

0 commit comments

Comments
 (0)