This commit is contained in:
		
							
								
								
									
										42
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,28 +1,22 @@
 | 
			
		||||
# Use the official lightweight Python image.
 | 
			
		||||
# https://hub.docker.com/_/python
 | 
			
		||||
FROM python:3.8-slim
 | 
			
		||||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
 | 
			
		||||
 | 
			
		||||
# Copy local code to the container image.
 | 
			
		||||
ENV APP_HOME /app
 | 
			
		||||
ENV PIP_NO_CACHE_DIR=true
 | 
			
		||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
EXPOSE 80
 | 
			
		||||
EXPOSE 443
 | 
			
		||||
 | 
			
		||||
# Set timezone
 | 
			
		||||
ENV TZ Europe/Budapest
 | 
			
		||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 | 
			
		||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
 | 
			
		||||
WORKDIR /src
 | 
			
		||||
COPY ["OutputServiceTSDB.csproj", ""]
 | 
			
		||||
RUN dotnet restore "./OutputServiceTSDB.csproj"
 | 
			
		||||
COPY . .
 | 
			
		||||
WORKDIR "/src/."
 | 
			
		||||
RUN dotnet build "OutputServiceTSDB.csproj" -c Release -o /app/build
 | 
			
		||||
 | 
			
		||||
WORKDIR $APP_HOME
 | 
			
		||||
FROM build AS publish
 | 
			
		||||
RUN dotnet publish "OutputServiceTSDB.csproj" -c Release -o /app/publish
 | 
			
		||||
 | 
			
		||||
ARG RELEASE_ID
 | 
			
		||||
ENV RELEASE_ID ${RELEASE_ID:-""}
 | 
			
		||||
 | 
			
		||||
#Copy requirements to install
 | 
			
		||||
COPY requirements.txt ./
 | 
			
		||||
 | 
			
		||||
# Install production dependencies.
 | 
			
		||||
RUN pip install -r requirements.txt
 | 
			
		||||
 | 
			
		||||
COPY ./src ./src
 | 
			
		||||
 | 
			
		||||
EXPOSE 8080
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8080", "--workers", "1", "--threads", "8", "app:app"]
 | 
			
		||||
FROM base AS final
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
COPY --from=publish /app/publish .
 | 
			
		||||
ENTRYPOINT ["dotnet", "OutputServiceTSDB.dll"]
 | 
			
		||||
		Reference in New Issue
	
	Block a user