Spaces:
Sleeping
Sleeping
ezequiellopez
commited on
Commit
·
5dcac49
1
Parent(s):
97694e1
fixing dockerfile
Browse files- Dockerfile +10 -1
Dockerfile
CHANGED
@@ -8,14 +8,18 @@ ENV PYTHONUNBUFFERED 1
|
|
8 |
ENV HF_HOME "app/cache"
|
9 |
ENV TRANSFORMERS_CACHE "app/cache"
|
10 |
|
|
|
|
|
11 |
RUN useradd -m -u 1000 user
|
|
|
|
|
12 |
USER user
|
13 |
|
14 |
# Set the working directory in the container
|
15 |
WORKDIR /app
|
16 |
|
17 |
# Upgrade pip to the latest version and install Python dependencies
|
18 |
-
COPY requirements.txt .
|
19 |
|
20 |
#RUN chown -R user:user /app
|
21 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
@@ -24,6 +28,11 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
24 |
COPY --chown=user:user ./app .
|
25 |
COPY --chown=user:user .env .
|
26 |
|
|
|
|
|
|
|
|
|
|
|
27 |
# Expose port 7860 for the application
|
28 |
EXPOSE 7860
|
29 |
|
|
|
8 |
ENV HF_HOME "app/cache"
|
9 |
ENV TRANSFORMERS_CACHE "app/cache"
|
10 |
|
11 |
+
### Set up user with permissions
|
12 |
+
# Set up a new user named "user" with user ID 1000
|
13 |
RUN useradd -m -u 1000 user
|
14 |
+
|
15 |
+
# Switch to the "user" user
|
16 |
USER user
|
17 |
|
18 |
# Set the working directory in the container
|
19 |
WORKDIR /app
|
20 |
|
21 |
# Upgrade pip to the latest version and install Python dependencies
|
22 |
+
COPY --chown=user requirements.txt .
|
23 |
|
24 |
#RUN chown -R user:user /app
|
25 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
|
28 |
COPY --chown=user:user ./app .
|
29 |
COPY --chown=user:user .env .
|
30 |
|
31 |
+
### Update permissions for the app
|
32 |
+
USER root
|
33 |
+
RUN chmod 777 app/*
|
34 |
+
USER user
|
35 |
+
|
36 |
# Expose port 7860 for the application
|
37 |
EXPOSE 7860
|
38 |
|