21
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								Dockerfile
									
									
									
									
									
								
							@ -1,31 +1,16 @@
 | 
			
		||||
FROM python:3.9.6-slim-buster
 | 
			
		||||
 | 
			
		||||
RUN useradd -m lenochka
 | 
			
		||||
 | 
			
		||||
USER lenochka
 | 
			
		||||
RUN pip install poetry==1.1.6
 | 
			
		||||
RUN pip install poetry==1.5.1
 | 
			
		||||
 | 
			
		||||
ENV PATH="${PATH}:/home/lenochka/.poetry/bin:/home/lenochka/.local/bin"
 | 
			
		||||
 | 
			
		||||
# Installing requirements
 | 
			
		||||
RUN poetry config virtualenvs.create false
 | 
			
		||||
 | 
			
		||||
COPY pyproject.toml poetry.lock /home/lenochka/app/
 | 
			
		||||
WORKDIR /home/lenochka/app/
 | 
			
		||||
RUN poetry install --only main
 | 
			
		||||
 | 
			
		||||
RUN poetry install --no-dev
 | 
			
		||||
 | 
			
		||||
# Copying actuall application
 | 
			
		||||
COPY . /home/lenochka/app/src/
 | 
			
		||||
WORKDIR /home/lenochka/app/src/
 | 
			
		||||
RUN pip install --use-feature=in-tree-build  .
 | 
			
		||||
 | 
			
		||||
WORKDIR /home/lenochka/app
 | 
			
		||||
 | 
			
		||||
USER root
 | 
			
		||||
RUN rm -rf /home/lenochka/app/src
 | 
			
		||||
RUN chown -R lenochka /home/lenochka
 | 
			
		||||
RUN chmod -R 700 /home/lenochka
 | 
			
		||||
USER lenochka
 | 
			
		||||
RUN poetry install --only main
 | 
			
		||||
 | 
			
		||||
CMD "lenochka_wake_up"
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user