Upload Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
# Create a non-root user for security
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
+
USER user
|
| 6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 7 |
+
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
# Copy and install dependencies
|
| 11 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
+
|
| 14 |
+
# Copy the entire project into the container
|
| 15 |
+
COPY --chown=user . /app
|
| 16 |
+
|
| 17 |
+
# Expose the port the app runs on
|
| 18 |
+
EXPOSE 7860
|
| 19 |
+
|
| 20 |
+
# Default command: launch the Gradio demo.
|
| 21 |
+
# Adjust the command-line arguments if necessary.
|
| 22 |
+
CMD ["python", "demo/app.py", "--model", "checkpoints/epoch1.pt", "--config", "config/gpt_small.yaml", "--tokenizer", "tokenizer"]
|