1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 13:15:18 +02:00

feat: Add CDN generation scripts and Docker setup; include Nginx configuration

This commit is contained in:
Sean Morley 2025-02-02 20:31:28 -05:00
parent 659c56f02d
commit dc169d1046
8 changed files with 117 additions and 0 deletions

33
cdn/Dockerfile Normal file
View file

@ -0,0 +1,33 @@
# Use an official Python image as a base
FROM python:3.11-slim
# Set the working directory
WORKDIR /app
# Install required Python packages
RUN pip install --no-cache-dir requests osm2geojson
# Copy the script and data folder into the container
COPY main.py /app/main.py
COPY data /app/data/
# Ensure the data folder exists
RUN mkdir -p /app/data
# Run the script to generate GeoJSON files
RUN python /app/main.py
# Install Nginx
RUN apt update && apt install -y nginx && rm -rf /var/lib/apt/lists/*
# Copy the entire data folder to the Nginx serving directory
RUN mkdir -p /var/www/html/data && cp -r /app/data/* /var/www/html/data/
# Copy Nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port 80 for Nginx
EXPOSE 80
# Start Nginx in the foreground
CMD ["nginx", "-g", "daemon off;"]