37
									
								
								deploy/dockerfiles/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								deploy/dockerfiles/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,37 @@
 | 
			
		||||
FROM python:3.9-alpine3.13
 | 
			
		||||
 | 
			
		||||
RUN adduser --disabled-password lenochka
 | 
			
		||||
 | 
			
		||||
RUN apk add --no-cache curl gcc musl-dev
 | 
			
		||||
 | 
			
		||||
ENV POETRY_VERSION 1.1.6
 | 
			
		||||
 | 
			
		||||
USER lenochka
 | 
			
		||||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
 | 
			
		||||
 | 
			
		||||
ENV PATH="${PATH}:/home/lenochka/.poetry/bin:/home/lenochka/.local/bin"
 | 
			
		||||
RUN source "/home/lenochka/.poetry/env"
 | 
			
		||||
 | 
			
		||||
# Installing requirements
 | 
			
		||||
RUN poetry config virtualenvs.create false
 | 
			
		||||
 | 
			
		||||
COPY pyproject.toml poetry.lock /home/lenochka/app/
 | 
			
		||||
WORKDIR /home/lenochka/app/
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
RUN apk del curl gcc musl-dev
 | 
			
		||||
USER lenochka
 | 
			
		||||
 | 
			
		||||
CMD "lenochka_wake_up"
 | 
			
		||||
		Reference in New Issue
	
	Block a user