Spaces:
Running
Running
Commit
·
abf4f97
1
Parent(s):
f15e88e
update
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
@@ -14,7 +14,7 @@ WORKDIR $HOME
|
|
14 |
RUN mkdir -p $HOME/app
|
15 |
|
16 |
# Copy the application files into the 'app' directory
|
17 |
-
COPY --chown=user:user .
|
18 |
|
19 |
# Copy the requirements file to the /code directory
|
20 |
COPY ./requirements.txt /code/requirements.txt
|
@@ -23,22 +23,22 @@ COPY ./requirements.txt /code/requirements.txt
|
|
23 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
24 |
|
25 |
# Create a directory for cache and set permissions
|
26 |
-
RUN mkdir -p
|
27 |
|
28 |
# Create the database file and set permissions
|
29 |
-
RUN touch
|
30 |
|
31 |
# Change ownership of mentor.txt and temp_mentor.txt
|
32 |
-
RUN chown user:user
|
33 |
|
34 |
# Change ownership of the 'app' directory
|
35 |
-
RUN chown user:user
|
36 |
|
37 |
# Switch back to the user
|
38 |
USER user
|
39 |
|
40 |
# Set the working directory for the application
|
41 |
-
WORKDIR
|
42 |
|
43 |
# Start the application using gunicorn
|
44 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "--timeout", "300", "main:app"]
|
|
|
14 |
RUN mkdir -p $HOME/app
|
15 |
|
16 |
# Copy the application files into the 'app' directory
|
17 |
+
COPY --chown=user:user . /app
|
18 |
|
19 |
# Copy the requirements file to the /code directory
|
20 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
23 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
24 |
|
25 |
# Create a directory for cache and set permissions
|
26 |
+
RUN mkdir -p /.cache && chmod 777 /.cache && chown user:user /.cache
|
27 |
|
28 |
# Create the database file and set permissions
|
29 |
+
RUN touch /app/users.db && chmod 777 /app/users.db && chown user:user /app/users.db
|
30 |
|
31 |
# Change ownership of mentor.txt and temp_mentor.txt
|
32 |
+
RUN chown user:user /app/mentor.txt /app/temp_mentor.txt
|
33 |
|
34 |
# Change ownership of the 'app' directory
|
35 |
+
RUN chown user:user /app
|
36 |
|
37 |
# Switch back to the user
|
38 |
USER user
|
39 |
|
40 |
# Set the working directory for the application
|
41 |
+
WORKDIR /app
|
42 |
|
43 |
# Start the application using gunicorn
|
44 |
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "--timeout", "300", "main:app"]
|