ci(docker): containerize application and add forgejo deployment workflow
This commit is contained in:
parent
b72ad44318
commit
afeb502b8e
5 changed files with 111 additions and 0 deletions
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Use official lightweight Python base image
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set working directory inside container
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python dependencies first to leverage Docker layer caching
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application files
|
||||
COPY . .
|
||||
|
||||
# Expose default port
|
||||
EXPOSE 8000
|
||||
|
||||
# Set default environment variables
|
||||
ENV PORT=8000
|
||||
ENV USER_AGENT="Phikipathia/1.0 (Wikipedia Philosophy Path Visualizer; https://github.com/tdpeuter/2022ST-project-Phikipathia)"
|
||||
|
||||
# Run Python HTTP server
|
||||
CMD ["python", "server.py"]
|
||||
Reference in a new issue