add docker stuff
This commit is contained in:
		
							
								
								
									
										6
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
.venv
 | 
			
		||||
**/*.pyc
 | 
			
		||||
 | 
			
		||||
data/db/*
 | 
			
		||||
data/static/avatars/*
 | 
			
		||||
!data/static/avatars/default.webp
 | 
			
		||||
							
								
								
									
										28
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
FROM python:3.13-slim
 | 
			
		||||
 | 
			
		||||
RUN apt-get update && apt-get install -y \
 | 
			
		||||
    nginx \
 | 
			
		||||
    uwsgi \
 | 
			
		||||
    uwsgi-plugin-python3 \
 | 
			
		||||
    sqlite3 \
 | 
			
		||||
    libargon2 \
 | 
			
		||||
    imagemagick \
 | 
			
		||||
    && rm -rf /var/lib/apt/lists/*
 | 
			
		||||
 | 
			
		||||
RUN python -m venv /opt/venv
 | 
			
		||||
ENV PATH="/opt/venv/bin:$PATH"
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY requirements.txt .
 | 
			
		||||
RUN /opt/venv/bin/pip install --no-cache-dir -r requirements.txt
 | 
			
		||||
 | 
			
		||||
COPY . .
 | 
			
		||||
 | 
			
		||||
RUN mkdir -p /app/data/static
 | 
			
		||||
RUN mkdir -p /app/data/db
 | 
			
		||||
 | 
			
		||||
RUN chown -R www-data:www-data /app/data/
 | 
			
		||||
COPY nginx.conf /etc/nginx/nginx.conf
 | 
			
		||||
COPY uwsgi.ini /app/
 | 
			
		||||
 | 
			
		||||
CMD ["sh", "-c", "uwsgi --ini uwsgi.ini & nginx -g 'daemon off;'"]
 | 
			
		||||
							
								
								
									
										13
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
version: '3.8'
 | 
			
		||||
 | 
			
		||||
services:
 | 
			
		||||
  pyrom:
 | 
			
		||||
    build: .
 | 
			
		||||
    ports:
 | 
			
		||||
      - "8080:8080"
 | 
			
		||||
    volumes:
 | 
			
		||||
      - ./data/static:/app/data/static
 | 
			
		||||
      - ./data/db:/app/data/db
 | 
			
		||||
    environment:
 | 
			
		||||
      - PYROM_PROD=true
 | 
			
		||||
    restart: unless-stopped
 | 
			
		||||
							
								
								
									
										19
									
								
								nginx.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								nginx.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
events {
 | 
			
		||||
    worker_connections 1024;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
http {
 | 
			
		||||
    server {
 | 
			
		||||
        listen 8080;
 | 
			
		||||
        server_name localhost;
 | 
			
		||||
 | 
			
		||||
        location /static/ {
 | 
			
		||||
            alias /data/static/;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        location / {
 | 
			
		||||
            include uwsgi_params;
 | 
			
		||||
            uwsgi_pass unix:///tmp/uwsgi.sock;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user