-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (28 loc) · 1.13 KB
/
Dockerfile
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
# Use the official Nginx image as base
FROM nginx:latest
# Install inotify-tools for file monitoring
RUN apt-get update && apt-get install -y inotify-tools python3 iputils-ping
# Copy the initial routes.trp file
COPY routes.trp /etc/nginx/routes.trp
# Copy the nginx configuration file with dynamic routing
COPY nginx.conf /etc/nginx/nginx.conf
COPY child_configs.conf /etc/nginx/child_configs.conf
COPY util.sh /etc/nginx/util.sh
RUN chmod +x /etc/nginx/util.sh
COPY config_checker.sh /etc/nginx/config_checker.sh
RUN chmod +x /etc/nginx/config_checker.sh
# Copy the script for monitoring and updating nginx configuration
COPY watch_routes.sh /usr/local/bin/watch_routes.sh
RUN chmod +x /usr/local/bin/watch_routes.sh
# Copy the script for validating and trimming URLs
COPY url_validate_and_trim.py /usr/local/bin/url_validate_and_trim.py
RUN chmod +x /usr/local/bin/url_validate_and_trim.py
# Copy the script for preping URLs
COPY preping.py /usr/local/bin/preping.py
RUN chmod +x /usr/local/bin/preping.py
# Expose ports
EXPOSE 80
EXPOSE 443
WORKDIR /usr/local/bin
# Start Nginx and monitoring script
CMD ["sh", "-c", "nginx && watch_routes.sh"]