2025-02-02 20:31:28 -05:00
|
|
|
# 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
|
|
|
|
|
2025-02-05 16:50:05 -05:00
|
|
|
# Copy the script into the container
|
2025-02-02 20:31:28 -05:00
|
|
|
COPY main.py /app/main.py
|
|
|
|
|
2025-02-05 16:50:05 -05:00
|
|
|
# Run the script to generate the data folder and GeoJSON files (this runs inside the container)
|
|
|
|
RUN python -u /app/main.py
|
2025-02-02 20:31:28 -05:00
|
|
|
|
|
|
|
# Install Nginx
|
|
|
|
RUN apt update && apt install -y nginx && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2025-02-05 16:50:05 -05:00
|
|
|
# Copy the entire generated data folder to the Nginx serving directory
|
2025-02-02 20:31:28 -05:00
|
|
|
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
|
|
|
|
|
2025-02-04 17:19:58 -05:00
|
|
|
# Copy the index.html file to the Nginx serving directory
|
|
|
|
COPY index.html /usr/share/nginx/html/index.html
|
|
|
|
|
2025-02-02 20:31:28 -05:00
|
|
|
# Expose port 80 for Nginx
|
|
|
|
EXPOSE 80
|
|
|
|
|
2025-02-05 16:50:05 -05:00
|
|
|
# Copy the entrypoint script into the container
|
|
|
|
COPY entrypoint.sh /app/entrypoint.sh
|
|
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
|
|
|
|
# Set the entrypoint script as the default command
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|