26 lines
		
	
	
		
			466 B
		
	
	
	
		
			Docker
		
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			466 B
		
	
	
	
		
			Docker
		
	
	
	
| FROM python:slim
 | |
| 
 | |
| RUN useradd microblog
 | |
| 
 | |
| WORKDIR /home/microblog
 | |
| 
 | |
| COPY requirements.txt requirements.txt
 | |
| RUN python -m venv venv
 | |
| RUN venv/bin/pip install -r requirements.txt
 | |
| RUN venv/bin/pip install gunicorn pymysql cryptography
 | |
| 
 | |
| COPY app app
 | |
| COPY migrations migrations
 | |
| COPY microblog.py config.py boot.sh ./
 | |
| RUN chmod a+x boot.sh
 | |
| 
 | |
| ENV FLASK_APP microblog.py
 | |
| 
 | |
| RUN chown -R microblog:microblog ./
 | |
| USER microblog
 | |
| 
 | |
| LABEL microblog
 | |
| 
 | |
| EXPOSE 5000
 | |
| ENTRYPOINT ["./boot.sh"]
 |