File size: 1,397 Bytes
f049087
 
c1459bc
f049087
c1459bc
 
f049087
 
c1459bc
f049087
 
c1459bc
f049087
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1459bc
 
 
 
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
# dockerfile from miniconda image copy local requirements.yaml and install
FROM continuumio/miniconda3:23.3.1-0

# set working directory
WORKDIR /code

# export port 50806 for shiny development
EXPOSE 50806

# work as user, home folder, create bashrc
SHELL ["/bin/bash", "-c"]

# install mamba
COPY env.yaml env.yaml
RUN conda install -c conda-forge mamba
RUN mamba env update -n base -f env.yaml

# use bash as default for the rest of the build

# install quarto cli (https://quarto.org/docs/download/tarball.html)
# select appropriate version for arch
RUN if [ "$(uname -m)" = "x86_64" ]; then \
    wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.450/quarto-1.3.450-linux-amd64.tar.gz \
    && tar -C /opt -xvzf quarto-1.3.450-linux-amd64.tar.gz; \
    else \
    wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.450/quarto-1.3.450-linux-arm64.tar.gz \
    && tar -C /opt -xvzf quarto-1.3.450-linux-arm64.tar.gz; \
    fi

# create symlink and add location to path
RUN ln -s /opt/quarto-1.3.450/bin/quarto /bin/quarto

# # # check installation
RUN quarto check

# install pip requirements
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

# copy all other files
COPY app.py app.py
COPY data data
COPY models.py models.py
COPY utils.py utils.py

EXPOSE 7860

CMD ["shiny", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]