Created
March 8, 2022 20:01
-
-
Save harishkashyap/0a5a3fe0f79ab8bbd592e6d09eb3c562 to your computer and use it in GitHub Desktop.
Dockerfile for Deployment of a Python Module to an EC2 instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8-slim | |
WORKDIR /usr/app/src | |
RUN pip install --upgrade pip | |
COPY requirements.txt ./requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
RUN pip install . | |
EXPOSE 8501 | |
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