wip-python -> Python rewriting + better logs + backup + update at startup #3
							
								
								
									
										29
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,21 +1,24 @@
 | 
				
			|||||||
FROM python:3.11-slim
 | 
					FROM python:3.11-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Install curl and cron
 | 
					# Install required utilities
 | 
				
			||||||
RUN apt-get update && apt-get install -y curl cron && rm -rf /var/lib/apt/lists/*
 | 
					RUN apt-get update && apt-get install -y \
 | 
				
			||||||
 | 
					    curl \
 | 
				
			||||||
 | 
					    cron \
 | 
				
			||||||
 | 
					    tzdata \
 | 
				
			||||||
 | 
					    && rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Install Python requests
 | 
					# Copy scripts
 | 
				
			||||||
RUN pip install --no-cache-dir requests
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Create adguard config dir
 | 
					 | 
				
			||||||
RUN mkdir -p /adguard
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Copy update-blocklist script
 | 
					 | 
				
			||||||
COPY update-blocklist.py /usr/local/bin/update-blocklist.py
 | 
					COPY update-blocklist.py /usr/local/bin/update-blocklist.py
 | 
				
			||||||
RUN chmod +x /usr/local/bin/update-blocklist.py
 | 
					COPY entrypoint.py /usr/local/bin/entrypoint.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Copy entrypoint script (on next step)
 | 
					# Make scripts executable
 | 
				
			||||||
 | 
					RUN chmod +x /usr/local/bin/update-blocklist.py /usr/local/bin/entrypoint.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Setup cron config dir
 | 
					# Set default timezone (can be overridden with TZ env var)
 | 
				
			||||||
RUN mkdir -p /etc/crontabs
 | 
					ENV TZ=UTC
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Configure timezone (tzdata) — important for /usr/share/zoneinfo/*
 | 
				
			||||||
 | 
					RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Set entrypoint
 | 
				
			||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.py"]
 | 
					ENTRYPOINT ["/usr/local/bin/entrypoint.py"]
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user