3 changed files with 59 additions and 0 deletions
			
			
		@ -0,0 +1,8 @@ | 
				
			|||||||
 | 
					FROM python:3.10-slim-buster | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY requirements.txt ./ | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN pip install -r requirements.txt | 
				
			||||||
 | 
					COPY . . | 
				
			||||||
 | 
					ENTRYPOINT ["python", "solution.py"] | 
				
			||||||
 | 
					CMD ["--config_path=service.conf"] | 
				
			||||||
@ -0,0 +1,45 @@ | 
				
			|||||||
 | 
					all: | 
				
			||||||
 | 
						#call without target, exiting...
 | 
				
			||||||
 | 
					archive: | 
				
			||||||
 | 
						gtar -czvf solution.tar.gz \
 | 
				
			||||||
 | 
						requirements.txt \
 | 
				
			||||||
 | 
						Dockerfile \
 | 
				
			||||||
 | 
						Makefile \
 | 
				
			||||||
 | 
						service.conf \
 | 
				
			||||||
 | 
						solution.py \
 | 
				
			||||||
 | 
						server.py \
 | 
				
			||||||
 | 
						app_config.py \
 | 
				
			||||||
 | 
						config_object.py \
 | 
				
			||||||
 | 
						request_builder.py \
 | 
				
			||||||
 | 
						template_conf.conf \
 | 
				
			||||||
 | 
						request.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					send: | 
				
			||||||
 | 
						rsync -ahP \
 | 
				
			||||||
 | 
						requirements.txt \
 | 
				
			||||||
 | 
						Dockerfile \
 | 
				
			||||||
 | 
						Makefile \
 | 
				
			||||||
 | 
						service.conf \
 | 
				
			||||||
 | 
						solution.py \
 | 
				
			||||||
 | 
						server.py \
 | 
				
			||||||
 | 
						app_config.py \
 | 
				
			||||||
 | 
						config_object.py \
 | 
				
			||||||
 | 
						request_builder.py \
 | 
				
			||||||
 | 
						template_conf.conf \
 | 
				
			||||||
 | 
						request.json \
 | 
				
			||||||
 | 
						qemu-debian-mini:~/test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-run: docker-buld | 
				
			||||||
 | 
						# Одельно обращаю внимание на секцию --mount. Можно прокинуть
 | 
				
			||||||
 | 
						# путь к папке внутри контейнера жестко, но для демо-целей
 | 
				
			||||||
 | 
						# volume, на мой взгляд, чище
 | 
				
			||||||
 | 
						docker run -itd --rm \
 | 
				
			||||||
 | 
						--name solution \
 | 
				
			||||||
 | 
						--mount source=sol_volume,target=/ng \
 | 
				
			||||||
 | 
						--network host \
 | 
				
			||||||
 | 
						solution:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docker-buld: | 
				
			||||||
 | 
						docker build -t solution .
 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue