Skip to content

Instantly share code, notes, and snippets.

@pycaret
Created June 23, 2020 20:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pycaret/04a67556c5cdcb6d5aabe9d31c8ce3e6 to your computer and use it in GitHub Desktop.
Save pycaret/04a67556c5cdcb6d5aabe9d31c8ce3e6 to your computer and use it in GitHub Desktop.
FROM python:3.7
RUN pip install virtualenv
ENV VIRTUAL_ENV=/venv
RUN virtualenv venv -p python3
ENV PATH="VIRTUAL_ENV/bin:$PATH"
WORKDIR /app
ADD . /app
# Install dependencies
RUN pip install -r requirements.txt
# copying all files over
COPY . /app
# Expose port
ENV PORT 8501
# cmd to launch app when container is run
CMD streamlit run app.py
# streamlit-specific commands for config
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
RUN mkdir -p /root/.streamlit
RUN bash -c 'echo -e "\
[general]\n\
email = \"\"\n\
" > /root/.streamlit/credentials.toml'
RUN bash -c 'echo -e "\
[server]\n\
enableCORS = false\n\
" > /root/.streamlit/config.toml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment