Build new DockerFile / Update ports to 5000
This commit is contained in:
+52
-14
@@ -1,26 +1,64 @@
|
|||||||
# Build
|
######################
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
## Build Frontend ##
|
||||||
|
######################
|
||||||
|
|
||||||
|
FROM node:alpine AS build-frontend
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# Copy all projects
|
# Install the angular CLI
|
||||||
COPY ["src", "."]
|
RUN npm install -g @angular/cli
|
||||||
|
|
||||||
|
# Copy the package.json into this build step
|
||||||
|
COPY ./src/MistoxWebsite.Client/package.json ./
|
||||||
|
|
||||||
|
# Pull dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy the rest of the frontend over
|
||||||
|
COPY ./src/MistoxWebsite.Client/ ./
|
||||||
|
|
||||||
|
# Compile the source
|
||||||
|
RUN ng build
|
||||||
|
|
||||||
|
#####################
|
||||||
|
## Build Backend ##
|
||||||
|
#####################
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-backend
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Copy the csproj
|
||||||
|
COPY ./src/MistoxWebsite.Server/MistoxWebsite.Server.csproj ./
|
||||||
|
|
||||||
# Restore the Server
|
# Restore the Server
|
||||||
RUN dotnet restore 'MistoxWebsite.Server/MistoxWebsite.Server.csproj'
|
RUN dotnet restore './MistoxWebsite.Server.csproj'
|
||||||
|
|
||||||
# Publish
|
# Copy the rest of the backend over
|
||||||
FROM build as publish
|
COPY ./src/MistoxWebsite.Server/ ./
|
||||||
RUN dotnet publish 'MistoxWebsite.Server/MistoxWebsite.Server.csproj' -c Release -o /app/publish
|
|
||||||
|
# Build the source
|
||||||
|
RUN dotnet publish './MistoxWebsite.Server.csproj' -c Release -o /app/publish
|
||||||
|
|
||||||
|
################
|
||||||
|
## Publish ##
|
||||||
|
################
|
||||||
|
|
||||||
# Run the app
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||||
ENV ASPNETCORE_HTTP_PORTS=5001
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV ASPNETCORE_HTTP_PORTS=5000
|
||||||
ENV StripeKey=null
|
ENV StripeKey=null
|
||||||
ENV MySQLServer=null
|
ENV MySQLServer=null
|
||||||
ENV MySQLUser=null
|
ENV MySQLUser=null
|
||||||
ENV MySQLPass=null
|
ENV MySQLPass=null
|
||||||
ENV MySQLDatabase=Mistox
|
ENV MySQLDatabase=Mistox
|
||||||
EXPOSE 5001
|
|
||||||
WORKDIR /app
|
EXPOSE 5000
|
||||||
COPY --from=publish /app/publish .
|
|
||||||
ENTRYPOINT ["dotnet", "MistoxWebsite.Server.dll"]
|
# Copy in the server
|
||||||
|
COPY --from=build-backend /app/publish ./
|
||||||
|
|
||||||
|
# Copy in the client
|
||||||
|
COPY --from=build-frontend /src/resources/static/browser ./wwwroot/
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "MistoxWebsite.Server.dll", "--url", "http://localhost:5000"]
|
||||||
+1
-1
@@ -15,7 +15,7 @@ services:
|
|||||||
- EmailAddress=${Email_Address}
|
- EmailAddress=${Email_Address}
|
||||||
- EmailPassword=${Email_Password}
|
- EmailPassword=${Email_Password}
|
||||||
ports:
|
ports:
|
||||||
- 5001:5001
|
- 5000:5000
|
||||||
depends_on:
|
depends_on:
|
||||||
- mistox-database
|
- mistox-database
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user