mirror of
				https://github.com/simon987/bingo.git
				synced 2025-11-04 11:06:51 +00:00 
			
		
		
		
	dockerize...
This commit is contained in:
		
							parent
							
								
									b806560b63
								
							
						
					
					
						commit
						c1814d883d
					
				
							
								
								
									
										11
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
FROM python:3.8
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
 | 
			
		||||
ADD requirements.txt /app/requirements.txt
 | 
			
		||||
RUN pip install -r requirements.txt
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT ["python", "app.py"]
 | 
			
		||||
 | 
			
		||||
EXPOSE 80
 | 
			
		||||
COPY . /app
 | 
			
		||||
							
								
								
									
										13
									
								
								common.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								common.py
									
									
									
									
									
								
							@ -1,16 +1,17 @@
 | 
			
		||||
import logging
 | 
			
		||||
import sys
 | 
			
		||||
import os
 | 
			
		||||
from logging import FileHandler, StreamHandler
 | 
			
		||||
 | 
			
		||||
from models import DB
 | 
			
		||||
 | 
			
		||||
config = {
 | 
			
		||||
    "API_PORT": 3000,
 | 
			
		||||
    "API_HOST": "0.0.0.0",
 | 
			
		||||
    "REDIS_HOST": "localhost",
 | 
			
		||||
    "REDIS_PORT": 6379,
 | 
			
		||||
    "FLASK_SECRET": "secret!",
 | 
			
		||||
    "VERBOSE": False,
 | 
			
		||||
    "API_PORT": int(os.environ.get("BINGO_API_PORT", "3000")),
 | 
			
		||||
    "API_HOST": os.environ.get("BINGO_API_HOST", "0.0.0.0"),
 | 
			
		||||
    "REDIS_HOST": os.environ.get("BINGO_REDIS_HOST", "localhost"),
 | 
			
		||||
    "REDIS_PORT": int(os.environ.get("BINGO_REDIS_PORT", "6379")),
 | 
			
		||||
    "FLASK_SECRET": os.environ.get("BINGO_FLASK_SECRET", "secret!"),
 | 
			
		||||
    "VERBOSE": bool(os.environ.get("BINGO_VERBOSE", "True")),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
logger = logging.getLogger("default")
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										20
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
version: "2.1"
 | 
			
		||||
 | 
			
		||||
services:
 | 
			
		||||
  bingo:
 | 
			
		||||
    build: .
 | 
			
		||||
    ports:
 | 
			
		||||
      - 3000:80
 | 
			
		||||
    environment:
 | 
			
		||||
      - "BINGO_API_PORT=80"
 | 
			
		||||
      - "BINGO_API_HOST=0.0.0.0"
 | 
			
		||||
      - "BINGO_REDIS_PORT=6379"
 | 
			
		||||
      - "BINGO_REDIS_HOST=redis"
 | 
			
		||||
      - "BINGO_FLASK_SECRET=changeme"
 | 
			
		||||
      - "BINGO_VERBOSE=True"
 | 
			
		||||
    depends_on:
 | 
			
		||||
      redis:
 | 
			
		||||
        condition: service_started
 | 
			
		||||
    restart: always
 | 
			
		||||
  redis:
 | 
			
		||||
    image: redis
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
flask
 | 
			
		||||
flask-socketio
 | 
			
		||||
redis
 | 
			
		||||
eventlet
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user