-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ubuntu
55 lines (48 loc) · 1.67 KB
/
Dockerfile.ubuntu
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
52
53
54
55
# Copyright (c) 2022 Ho Kim ([email protected]). All rights reserved.
# Use of this source code is governed by a GPL-3-style license that can be
# found in the LICENSE file.
# Configure environment variables
ARG DEBIAN_IMAGE="docker.io/library/python"
ARG DEBIAN_VERSION="slim"
ARG PACKAGE="dash-streamlit"
ARG PYTHON_VERSION="3.12"
# Be ready for serving
FROM "${DEBIAN_IMAGE}:${DEBIAN_VERSION}"
# Package Manager Configuration
ARG DEBIAN_FRONTEND='noninteractive'
# Server Configuration
ENV OPENARK_TEMPLATES_DIR='/src/templates'
EXPOSE 80/tcp
WORKDIR /src
CMD [ "streamlit", "run", "main.py", "--browser.gatherUsageStats=False", "--server.address=0.0.0.0", "--server.baseUrlPath=/dash/", "--server.enableCORS=false", "--server.enableXsrfProtection=false", "--server.headless=true", "--server.port=80" ]
# Add dependencies file
ADD ./requirements.txt /src/requirements.txt
# Install dependencies
RUN apt-get update && apt-get install -y --ignore-missing \
build-essential \
cmake \
cython3 \
libcairo-dev \
libgirepository1.0-dev \
libopenblas-dev \
pkg-config \
python3-pip \
python3-setuptools \
python3-wheel \
$( \
cat requirements.txt | \
sed '/^#/ d' | \
sed 's/_/-/g' | \
sed 's/\[[0-9a-z_-]*\]//g' | \
sed 's/^py\(.*\)$/\1/g' | \
awk '{print "python3-"$1} {print "python3-py"$1}' | \
xargs apt list 2>/dev/null | \
sed 's/\/.*//g' | \
tail -n +2 \
) \
&& python3 -m pip install --break-system-packages --no-cache-dir --requirement ./requirements.txt \
# Cleanup
&& find /usr -type d -name '*__pycache__' -prune -exec rm -rf {} \; \
&& rm -rf /var/lib/apt/lists/*
# Add source code
ADD . /src