Class-Corder / Dockerfile
Dockerfile
Raw
FROM python:3.9-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*
COPY . /app/
RUN pip3 install -r requirements.txt
ARG GAI_API_KEY
ARG PROJECT
ARG BUCKET
ARG DATASET
RUN echo "gai_api_key = \"$GAI_API_KEY\"" > .streamlit/secrets.toml \
    && echo "project = \"$PROJECT\"" >> .streamlit/secrets.toml \
    && echo "bucket = \"$BUCKET\"" >> .streamlit/secrets.toml \
    && echo "dataset = \"$DATASET\"" >> .streamlit/secrets.toml \
    && echo "location = \"us-central1\"" >> .streamlit/secrets.toml
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
ENTRYPOINT ["/bin/sh", "start.sh"]