Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -8
Dockerfile
CHANGED
@@ -33,8 +33,8 @@ RUN groupadd -g 1000 appuser && useradd --no-log-init -u 1000 -g appuser appuser
|
|
33 |
# Then, set ownership of the entire /app directory (and its contents)
|
34 |
# to the 'appuser'. This ensures the application, running as 'appuser',
|
35 |
# has the necessary permissions, especially for /app/generated_images.
|
36 |
-
RUN mkdir -p
|
37 |
-
chown -R appuser:appuser
|
38 |
|
39 |
# Copy the requirements file first to leverage Docker layer caching.
|
40 |
# Ensure 'appuser' owns this copied file.
|
@@ -48,11 +48,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
48 |
# Ensure 'appuser' owns these copied files.
|
49 |
COPY --chown=appuser:appuser app.py .
|
50 |
|
51 |
-
#
|
52 |
-
#
|
53 |
-
# This file will be copied to /app/arial.ttf inside the container.
|
54 |
-
COPY --chown=appuser:appuser arial.ttf .
|
55 |
-
# ---- IMPORTANT ----
|
56 |
|
57 |
# Copy the entire 'templates' directory (and its contents) from your repository root
|
58 |
# to /app/templates inside the container.
|
@@ -65,7 +62,7 @@ USER appuser
|
|
65 |
|
66 |
# Define an environment variable placeholder for the Telegram token.
|
67 |
# The actual token MUST be set in your Hugging Face Space's secrets settings.
|
68 |
-
ENV TELEGRAM_TOKEN=""
|
69 |
|
70 |
# Command to run the application when the container launches.
|
71 |
# This executes 'python app.py' as the 'appuser'.
|
|
|
33 |
# Then, set ownership of the entire /app directory (and its contents)
|
34 |
# to the 'appuser'. This ensures the application, running as 'appuser',
|
35 |
# has the necessary permissions, especially for /app/generated_images.
|
36 |
+
RUN mkdir -p /app/templates /app/generated_images && \
|
37 |
+
chown -R appuser:appuser /app
|
38 |
|
39 |
# Copy the requirements file first to leverage Docker layer caching.
|
40 |
# Ensure 'appuser' owns this copied file.
|
|
|
48 |
# Ensure 'appuser' owns these copied files.
|
49 |
COPY --chown=appuser:appuser app.py .
|
50 |
|
51 |
+
# The line to copy 'arial.ttf' has been REMOVED.
|
52 |
+
# We will now rely on the system-installed Arial from 'ttf-mscorefonts-installer'.
|
|
|
|
|
|
|
53 |
|
54 |
# Copy the entire 'templates' directory (and its contents) from your repository root
|
55 |
# to /app/templates inside the container.
|
|
|
62 |
|
63 |
# Define an environment variable placeholder for the Telegram token.
|
64 |
# The actual token MUST be set in your Hugging Face Space's secrets settings.
|
65 |
+
ENV TELEGRAM_TOKEN="7229558358:AAH_btIdtnJvfGhh84O2uVa8wuH88ShUcy0"
|
66 |
|
67 |
# Command to run the application when the container launches.
|
68 |
# This executes 'python app.py' as the 'appuser'.
|