LukeZ-WIN commited on
Commit
3034f19
·
verified ·
1 Parent(s): b299b34

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +51 -0
Dockerfile ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ # Set timezone and avoid interactive prompts
4
+ ENV TZ=UTC \
5
+ DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Set timezone
8
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
9
+ echo $TZ > /etc/timezone
10
+
11
+ # Install dependencies
12
+ RUN apt-get update && \
13
+ apt-get install -y --no-install-recommends \
14
+ git \
15
+ python3 \
16
+ python3-pip \
17
+ tzdata \
18
+ curl \
19
+ ca-certificates && \
20
+ apt-get clean && \
21
+ rm -rf /var/lib/apt/lists/*
22
+
23
+ # Set working directory
24
+ WORKDIR /todo_api
25
+
26
+ # Clone the repository
27
+ RUN git clone --depth 1 https://github.com/siiway/Todo.API.git .
28
+
29
+ # Set environment variables for Python behavior
30
+ ENV PYTHONDONTWRITEBYTECODE=1 \
31
+ PYTHONUNBUFFERED=1
32
+
33
+ # Application environment variables will be set by the deployment platform
34
+ # Default values are only used if not provided by the platform:
35
+ # - TODO_TOKEN: Authentication token (required)
36
+ # - PAGE_TITLE: Custom title for the application (default: "ToDo App")
37
+ # - SHOW_ADMIN_PANEL_BUTTON: Whether to show admin panel button (default: true)
38
+ # - DEBUG_MODE: Enable Flask debug mode (default: false)
39
+
40
+ # Install dependencies
41
+ RUN pip3 install --no-cache-dir -r requirements.txt
42
+
43
+ # Create data directory for persistence and set permissions
44
+ RUN mkdir -p /todo_api/data && \
45
+ chmod -R 777 /todo_api
46
+
47
+ # Expose port
48
+ EXPOSE 5000
49
+
50
+ # Command to run the application
51
+ CMD ["python3", "app.py"]