building frontend in docker
This commit is contained in:
parent
e8ddc08937
commit
4cf5749d02
@ -11,16 +11,24 @@ RUN dotnet restore ./Selector.Web/Selector.Web.csproj
|
||||
|
||||
COPY . ./
|
||||
|
||||
FROM base as test
|
||||
RUN dotnet restore ./Selector.Tests/Selector.Tests.csproj
|
||||
RUN dotnet test --no-restore --verbosity normal
|
||||
# FROM base as test
|
||||
# RUN dotnet restore ./Selector.Tests/Selector.Tests.csproj
|
||||
# RUN dotnet test --no-restore
|
||||
|
||||
FROM base as publish
|
||||
RUN dotnet publish Selector.Web/Selector.Web.csproj -c Release -o /app --no-restore
|
||||
|
||||
FROM node as frontend
|
||||
COPY ./Selector.Web/package.json /Selector.Web/
|
||||
WORKDIR /Selector.Web
|
||||
RUN npm ci
|
||||
COPY ./Selector.Web/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0
|
||||
EXPOSE 80
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app ./
|
||||
COPY --from=frontend /Selector.Web/wwwroot ./Selector.Web/wwwroot/
|
||||
ENV DOTNET_EnableDiagnostics=0
|
||||
ENTRYPOINT ["dotnet", "Selector.Web.dll"]
|
||||
|
@ -10,7 +10,7 @@ services:
|
||||
- database
|
||||
- redis
|
||||
volumes:
|
||||
- "./Selector.Web/appsettings.Production.json:/appsettings.Production.json"
|
||||
- "./Selector.Web/appsettings.Production.json:/app/appsettings.Production.json"
|
||||
environment:
|
||||
DOTNET_ENVIRONMENT: Production
|
||||
|
||||
@ -22,7 +22,7 @@ services:
|
||||
- database
|
||||
- redis
|
||||
volumes:
|
||||
- "./Selector.CLI/appsettings.Production.json:/appsettings.Production.json"
|
||||
- "./Selector.CLI/appsettings.Production.json:/app/appsettings.Production.json"
|
||||
environment:
|
||||
DOTNET_ENVIRONMENT: Production
|
||||
|
||||
@ -34,4 +34,4 @@ services:
|
||||
image: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
env_file: .env # set POSTGRES_PASSWORD
|
||||
env_file: .env # set POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB
|
||||
|
@ -8,7 +8,7 @@ services:
|
||||
- database
|
||||
- redis
|
||||
volumes:
|
||||
- "./Selector.Web/appsettings.Production.json:/appsettings.Production.json"
|
||||
- "./Selector.Web/appsettings.Production.json:/app/appsettings.Production.json"
|
||||
environment:
|
||||
DOTNET_ENVIRONMENT: Production
|
||||
|
||||
@ -18,7 +18,7 @@ services:
|
||||
- database
|
||||
- redis
|
||||
volumes:
|
||||
- "./Selector.CLI/appsettings.Production.json:/appsettings.Production.json"
|
||||
- "./Selector.CLI/appsettings.Production.json:/app/appsettings.Production.json"
|
||||
environment:
|
||||
DOTNET_ENVIRONMENT: Production
|
||||
|
||||
@ -30,4 +30,4 @@ services:
|
||||
image: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
env_file: .env # set POSTGRES_PASSWORD
|
||||
env_file: .env # set POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB
|
||||
|
Loading…
Reference in New Issue
Block a user