Spaces:
Sleeping
Sleeping
Merge branch 'master'
Browse files- .gitignore +18 -0
- Dockerfile +9 -3
- app.py +5 -0
- git +0 -0
- requirements.txt +1 -1
- static/thumbnails/.gitkeep +0 -0
- static/watermarked_images/.gitkeep +0 -0
.gitignore
CHANGED
@@ -1 +1,19 @@
|
|
|
|
|
|
|
|
|
|
1 |
venv/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Python
|
2 |
+
__pycache__/
|
3 |
+
*.py[cod]
|
4 |
+
*$py.class
|
5 |
venv/
|
6 |
+
|
7 |
+
# Environment variables
|
8 |
+
.env
|
9 |
+
.env.*
|
10 |
+
|
11 |
+
# Generated content
|
12 |
+
static/watermarked_images/*
|
13 |
+
static/thumbnails/*
|
14 |
+
!static/watermarked_images/.gitkeep
|
15 |
+
!static/thumbnails/.gitkeep
|
16 |
+
|
17 |
+
# System files
|
18 |
+
.DS_Store
|
19 |
+
Thumbs.db
|
Dockerfile
CHANGED
@@ -10,12 +10,18 @@ COPY . /app
|
|
10 |
# Install the dependencies
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
-
# Set environment variables
|
14 |
ENV FLASK_APP=app.py
|
15 |
ENV FLASK_RUN_HOST=0.0.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
# Expose the port the app runs on
|
18 |
-
EXPOSE
|
19 |
|
20 |
# Define the command to run your app using Gunicorn
|
21 |
-
CMD ["
|
|
|
10 |
# Install the dependencies
|
11 |
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
+
# Set environment variables
|
14 |
ENV FLASK_APP=app.py
|
15 |
ENV FLASK_RUN_HOST=0.0.0.0
|
16 |
+
ENV PORT=7860
|
17 |
+
|
18 |
+
# Install system fonts
|
19 |
+
RUN apt-get update && apt-get install -y \
|
20 |
+
fonts-liberation \
|
21 |
+
&& rm -rf /var/lib/apt/lists/*
|
22 |
|
23 |
# Expose the port the app runs on
|
24 |
+
EXPOSE 7860
|
25 |
|
26 |
# Define the command to run your app using Gunicorn
|
27 |
+
CMD ["sh", "-c", "gunicorn app:app --bind 0.0.0.0:$PORT"]
|
app.py
CHANGED
@@ -5,7 +5,12 @@ import os
|
|
5 |
import zipfile
|
6 |
import base64
|
7 |
|
|
|
|
|
|
|
|
|
8 |
app = Flask(__name__)
|
|
|
9 |
|
10 |
# Configure upload folders with absolute paths
|
11 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
|
5 |
import zipfile
|
6 |
import base64
|
7 |
|
8 |
+
# Enable detailed logging for debugging
|
9 |
+
import logging
|
10 |
+
logging.basicConfig(level=logging.DEBUG)
|
11 |
+
|
12 |
app = Flask(__name__)
|
13 |
+
app.config['DEBUG'] = True # This enables debug mode for Flask
|
14 |
|
15 |
# Configure upload folders with absolute paths
|
16 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
git
ADDED
File without changes
|
requirements.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
Flask==2.2.0
|
2 |
-
Pillow
|
3 |
python-dotenv
|
4 |
gunicorn
|
5 |
Werkzeug==2.2.3
|
|
|
1 |
Flask==2.2.0
|
2 |
+
Pillow==10.0.0
|
3 |
python-dotenv
|
4 |
gunicorn
|
5 |
Werkzeug==2.2.3
|
static/thumbnails/.gitkeep
ADDED
File without changes
|
static/watermarked_images/.gitkeep
ADDED
File without changes
|