mirror of
				https://github.com/python-escpos/python-escpos
				synced 2025-10-23 09:30:00 +00:00 
			
		
		
		
	* Added example with Docker and Flask * set flask debug flag to False * new line at the end of file * format with black --------- Co-authored-by: Ricardo Sanchez Alba <r2sanchezalba@gmail.com>
		
			
				
	
	
		
			29 lines
		
	
	
		
			613 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			613 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
# Use the official Python image as the base image
 | 
						|
FROM python:3.9-slim
 | 
						|
 | 
						|
# Set the working directory
 | 
						|
WORKDIR /app
 | 
						|
 | 
						|
# Copy the requirements file
 | 
						|
COPY requirements.txt .
 | 
						|
 | 
						|
#Install the libcups library
 | 
						|
RUN apt-get update -y && apt-get install libcups2-dev -y
 | 
						|
# Install the Python packages
 | 
						|
RUN pip install --no-cache-dir -r requirements.txt
 | 
						|
RUN pip install python-escpos --pre
 | 
						|
 | 
						|
# Install Git
 | 
						|
RUN apt-get update && \
 | 
						|
    apt-get install -y git && \
 | 
						|
    rm -rf /var/lib/apt/lists/*
 | 
						|
 | 
						|
# Copy the Flask app
 | 
						|
COPY app.py .
 | 
						|
 | 
						|
# Expose the port the Flask app will run on
 | 
						|
EXPOSE 8080
 | 
						|
 | 
						|
# Run the Flask app
 | 
						|
CMD ["python", "app.py"]
 |