Replace as to AS to unify dockerfile grammar.

This commit is contained in:
Anduin Xue
2024-07-07 14:25:17 +00:00
parent 4d6033f73f
commit 7d32de3d12
+5 -5
View File
@@ -3,7 +3,7 @@ ARG PROJ_NAME="Aiursoft.ChessServer"
# ============================
# Prepare NPM Environment
FROM hub.aiursoft.cn/node:21-alpine as npm-env
FROM hub.aiursoft.cn/node:21-alpine AS npm-env
ARG CSPROJ_PATH
WORKDIR /src
COPY . .
@@ -13,19 +13,19 @@ RUN npm install --prefix "${CSPROJ_PATH}wwwroot"
# ============================
# Prepare Building Environment
FROM hub.aiursoft.cn/mcr.microsoft.com/dotnet/sdk:8.0 as build-env
FROM hub.aiursoft.cn/mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ARG CSPROJ_PATH
ARG PROJ_NAME
WORKDIR /src
COPY --from=npm-env /src .
# Build
RUN dotnet publish ${CSPROJ_PATH}${PROJ_NAME}.csproj --configuration Release --no-self-contained --runtime linux-x64 --output /app
RUN dotnet publish ${CSPROJ_PATH}${PROJ_NAME}.csproj --configuration ReleASe --no-self-contained --runtime linux-x64 --output /app
RUN cp -r ${CSPROJ_PATH}/wwwroot/* /app/wwwroot
# ============================
# Prepare Runtime Environment
FROM hub.aiursoft.cn/mcr.microsoft.com/dotnet/aspnet:8.0
FROM hub.aiursoft.cn/mcr.microsoft.com/dotnet/ASpnet:8.0
ARG PROJ_NAME
WORKDIR /app
COPY --from=build-env /app .
@@ -46,7 +46,7 @@ ENV VOL_SETTINGS=/data/appsettings.json
ENV DLL_NAME=${PROJ_NAME}.dll
#ENTRYPOINT dotnet $DLL_NAME --urls http://*:5000
ENTRYPOINT ["/bin/bash", "-c", "\
ENTRYPOINT ["/bin/bASh", "-c", "\
if [ ! -f \"$VOL_SETTINGS\" ]; then \
cp $SRC_SETTINGS $VOL_SETTINGS; \
fi && \