mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-05 13:15:18 +02:00
feat: Enhance CDN management with entrypoint script and update country data handling
This commit is contained in:
parent
f7ff8f30b0
commit
921e756aef
4 changed files with 22 additions and 12 deletions
|
@ -7,20 +7,16 @@ WORKDIR /app
|
|||
# Install required Python packages
|
||||
RUN pip install --no-cache-dir requests osm2geojson
|
||||
|
||||
# Copy the script and data folder into the container
|
||||
# Copy the script 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
|
||||
# Run the script to generate the data folder and GeoJSON files (this runs inside the container)
|
||||
RUN python -u /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
|
||||
# Copy the entire generated 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
|
||||
|
@ -32,5 +28,9 @@ COPY index.html /usr/share/nginx/html/index.html
|
|||
# Expose port 80 for Nginx
|
||||
EXPOSE 80
|
||||
|
||||
# Start Nginx in the foreground
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
# 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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue