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