docker update
This commit is contained in:
		
							parent
							
								
									7a0c4645d7
								
							
						
					
					
						commit
						acecd446b8
					
				
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -8,4 +8,5 @@ venv/
 | 
				
			|||||||
# Local data & secrets (we’ll mount these in Docker)
 | 
					# Local data & secrets (we’ll mount these in Docker)
 | 
				
			||||||
data/
 | 
					data/
 | 
				
			||||||
data.json
 | 
					data.json
 | 
				
			||||||
settings.conf
 | 
					settings.conf
 | 
				
			||||||
 | 
					settings local.conf
 | 
				
			||||||
							
								
								
									
										21
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					version: "3.8"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  shaiwatcher:
 | 
				
			||||||
 | 
					    build: .
 | 
				
			||||||
 | 
					    image: shaiwatcher:latest           # local image name (Portainer builds it)
 | 
				
			||||||
 | 
					    container_name: shaiwatcher
 | 
				
			||||||
 | 
					    restart: unless-stopped
 | 
				
			||||||
 | 
					    environment:
 | 
				
			||||||
 | 
					      # set this in Portainer (don’t commit your token!)
 | 
				
			||||||
 | 
					      - DISCORD_TOKEN=${DISCORD_TOKEN}
 | 
				
			||||||
 | 
					      # optional: set timezone
 | 
				
			||||||
 | 
					      - TZ=UTC
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      # Persist your JSON data here
 | 
				
			||||||
 | 
					      - shaiwatcher-data:/app/data
 | 
				
			||||||
 | 
					      # Bind your server-side settings.conf into the container
 | 
				
			||||||
 | 
					      - /opt/shaiwatcher/settings.conf:/app/settings.conf:ro
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  shaiwatcher-data:
 | 
				
			||||||
							
								
								
									
										23
									
								
								dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					# Simple, small image
 | 
				
			||||||
 | 
					FROM python:3.11-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV PYTHONUNBUFFERED=1 \
 | 
				
			||||||
 | 
					    PIP_NO_CACHE_DIR=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# System deps (add git if you need it)
 | 
				
			||||||
 | 
					RUN apt-get update && apt-get install -y --no-install-recommends \
 | 
				
			||||||
 | 
					    ca-certificates tzdata && \
 | 
				
			||||||
 | 
					    rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install deps first (better cache)
 | 
				
			||||||
 | 
					COPY requirements.txt .
 | 
				
			||||||
 | 
					RUN pip install -r requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Copy the app
 | 
				
			||||||
 | 
					COPY . .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# The bot reads settings.conf from /app/settings.conf
 | 
				
			||||||
 | 
					# The data file should live in /app/data (mounted as a volume)
 | 
				
			||||||
 | 
					CMD ["python", "-u", "bot.py"]
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user