Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.11.1 | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Run the container as root | |
| # USER root | |
| # Change permissions of the working directory | |
| RUN chmod 777 /app # Gives all users read, write, and exec permissions in the app directory. | |
| # Copy the current directory contents into the container at /usr/src/app | |
| COPY . . | |
| # Install dependencies | |
| # RUN poetry config virtualenvs.create false \ | |
| # && poetry install --no-interaction --no-ansi | |
| # Streamlit must be installed separately. Potentially this will cause an issue with dependencies in the future, but it's the only way it works. | |
| # RUN pip3 install streamlit | |
| # Install dependencies | |
| RUN pip3 install -r requirements.txt | |
| # Make a port available to the world outside this container | |
| # The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. Your container needs to listen to Streamlit’s (default) port 8501. | |
| EXPOSE 8501 | |
| # The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working. Your container needs to listen to Streamlit’s (default) port 8501: | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| # Set the permissions for the script file | |
| # RUN chmod +x python 3 train_llm.py | |
| # Run the command inside your image filesystem. | |
| CMD ["python", "train_llm.py"] | |
| # Execute with: | |
| # docker build -t <image_name> . | |
| # docker run -p 8501:8501 <image_name> |