Ludvig
commited on
Commit
·
e100ef9
1
Parent(s):
e2a604d
First attempt at dockerfile. Clean up
Browse files- Dockerfile +22 -0
- design.py +0 -2
- environment.yml +19 -0
- requirements.txt +0 -15
- utils.py +1 -1
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM continuumio/miniconda3
|
| 2 |
+
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
# Create the environment:
|
| 6 |
+
COPY ./environment.yml /code/environment.yml
|
| 7 |
+
RUN conda env create -f environment.yml
|
| 8 |
+
|
| 9 |
+
# Make RUN commands use the new environment:
|
| 10 |
+
SHELL ["conda", "run", "-n", "plt_env", "/bin/bash", "-c"]
|
| 11 |
+
|
| 12 |
+
# Demonstrate the environment is activated:
|
| 13 |
+
RUN echo "Make sure flask is installed:"
|
| 14 |
+
RUN python -c "import flask"
|
| 15 |
+
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# The code to run when container is started:
|
| 19 |
+
# server.address 0.0.0.0 ?
|
| 20 |
+
|
| 21 |
+
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "plt_env", "streamlit", "run", "app.py", "--server.port", "7860"]
|
| 22 |
+
|
design.py
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
-
import pathlib
|
| 2 |
from typing import List, Callable, Any, Tuple
|
| 3 |
import json
|
| 4 |
-
import numpy as np
|
| 5 |
import streamlit as st
|
| 6 |
|
| 7 |
from text_sections import (
|
|
|
|
|
|
|
| 1 |
from typing import List, Callable, Any, Tuple
|
| 2 |
import json
|
|
|
|
| 3 |
import streamlit as st
|
| 4 |
|
| 5 |
from text_sections import (
|
environment.yml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: plt_env
|
| 2 |
+
channels:
|
| 3 |
+
- conda-forge
|
| 4 |
+
dependencies:
|
| 5 |
+
- python=3.11
|
| 6 |
+
- streamlit=1.19.0
|
| 7 |
+
- PIL
|
| 8 |
+
- pandas
|
| 9 |
+
- lazyeval
|
| 10 |
+
- r-cvms
|
| 11 |
+
- r-dplyr
|
| 12 |
+
- r-ggplot2
|
| 13 |
+
- r-ggimage
|
| 14 |
+
- r-rsvg
|
| 15 |
+
- r-optparse
|
| 16 |
+
- r-ggnewscale
|
| 17 |
+
- r-stringr
|
| 18 |
+
- r-jsonlite
|
| 19 |
+
|
requirements.txt
CHANGED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
# rpy2=3.5.1
|
| 2 |
-
pandas
|
| 3 |
-
lazyeval
|
| 4 |
-
r-cvms
|
| 5 |
-
r-dplyr
|
| 6 |
-
r-ggimage
|
| 7 |
-
r-rsvg # Conda forge?
|
| 8 |
-
r-optparse
|
| 9 |
-
r-ggnewscale
|
| 10 |
-
r-stringr
|
| 11 |
-
r-jsonlite
|
| 12 |
-
|
| 13 |
-
# Needs:
|
| 14 |
-
# conda config --add channels conda-forge
|
| 15 |
-
# conda config --set channel_priority strict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
utils.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import subprocess
|
| 2 |
-
import re
|
| 3 |
|
| 4 |
|
| 5 |
def call_subprocess(call_, message, return_output=False, encoding="UTF-8"):
|
|
|
|
| 1 |
import subprocess
|
| 2 |
+
import re
|
| 3 |
|
| 4 |
|
| 5 |
def call_subprocess(call_, message, return_output=False, encoding="UTF-8"):
|