Spaces:
Sleeping
Sleeping
LVKinyanjui
commited on
Commit
•
f663c35
1
Parent(s):
09b5d8c
Cleaned up dockerfile to improve readability
Browse files- Dockerfile +2 -41
Dockerfile
CHANGED
@@ -1,53 +1,14 @@
|
|
1 |
-
# syntax=docker/dockerfile:1
|
2 |
-
|
3 |
-
# Comments are provided throughout this file to help you get started.
|
4 |
-
# If you need more help, visit the Dockerfile reference guide at
|
5 |
-
# https://docs.docker.com/go/dockerfile-reference/
|
6 |
-
|
7 |
-
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7
|
8 |
-
|
9 |
ARG PYTHON_VERSION=3.10.12
|
10 |
FROM python:${PYTHON_VERSION}-slim as base
|
11 |
|
12 |
-
# Prevents Python from writing pyc files.
|
13 |
-
ENV PYTHONDONTWRITEBYTECODE=1
|
14 |
-
|
15 |
-
# Keeps Python from buffering stdout and stderr to avoid situations where
|
16 |
-
# the application crashes without emitting any logs due to buffering.
|
17 |
-
ENV PYTHONUNBUFFERED=1
|
18 |
-
|
19 |
WORKDIR /app
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
# ARG UID=10001
|
24 |
-
# RUN adduser \
|
25 |
-
# --disabled-password \
|
26 |
-
# --gecos "" \
|
27 |
-
# --home "/nonexistent" \
|
28 |
-
# --shell "/sbin/nologin" \
|
29 |
-
# --no-create-home \
|
30 |
-
# --uid "${UID}" \
|
31 |
-
# appuser
|
32 |
-
|
33 |
-
# # Download dependencies as a separate step to take advantage of Docker's caching.
|
34 |
-
# # Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
|
35 |
-
# # Leverage a bind mount to requirements.txt to avoid having to copy them into
|
36 |
-
# # into this layer.
|
37 |
-
|
38 |
-
RUN --mount=type=cache,target=/root/.cache/pip \
|
39 |
-
--mount=type=bind,source=requirements.txt,target=requirements.txt \
|
40 |
-
python -m pip install -r requirements.txt
|
41 |
-
|
42 |
-
# COPY requirements.txt .
|
43 |
-
# RUN python -m pip install --no-cache-dir -r requirements.txt
|
44 |
|
45 |
# # Install ollama
|
46 |
# RUN curl -fsSL https://ollama.com/install.sh | sh
|
47 |
|
48 |
-
# # Switch to the non-privileged user to run the application.
|
49 |
-
# USER appuser
|
50 |
-
|
51 |
# Copy the source code into the container.
|
52 |
COPY . .
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
ARG PYTHON_VERSION=3.10.12
|
2 |
FROM python:${PYTHON_VERSION}-slim as base
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
COPY requirements.txt .
|
7 |
+
RUN python -m pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# # Install ollama
|
10 |
# RUN curl -fsSL https://ollama.com/install.sh | sh
|
11 |
|
|
|
|
|
|
|
12 |
# Copy the source code into the container.
|
13 |
COPY . .
|
14 |
|