fix deploy config
This commit is contained in:
@@ -7,9 +7,11 @@ COPY ClientApp/ .
|
|||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Stage 2: Build the backend
|
# Stage 2: Build the backend
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS backend-build
|
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS backend-build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["backend.csproj", "."]
|
COPY nuget.config ./
|
||||||
|
COPY backend.csproj ./
|
||||||
|
RUN dotnet nuget list source
|
||||||
RUN dotnet restore
|
RUN dotnet restore
|
||||||
COPY . .
|
COPY . .
|
||||||
# Copy the frontend build output from the previous stage
|
# Copy the frontend build output from the previous stage
|
||||||
@@ -17,7 +19,7 @@ COPY --from=frontend-build /app/dist ./ClientApp/dist
|
|||||||
RUN dotnet publish -c Release -o /app/publish
|
RUN dotnet publish -c Release -o /app/publish
|
||||||
|
|
||||||
# Stage 3: Runtime
|
# Stage 3: Runtime
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
ENV ASPNETCORE_URLS=http://+:8080
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<SpaRoot>ClientApp\</SpaRoot>
|
<SpaRoot>ClientApp\</SpaRoot>
|
||||||
|
|||||||
8
backend/nuget.config
Normal file
8
backend/nuget.config
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<clear />
|
||||||
|
<add key="iki" value="https://nuget.devneeds.ir/repository/nuget/index.json" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
|
|
||||||
@@ -1,27 +1,7 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
sqlserver:
|
ghadir_back:
|
||||||
image: mcr.microsoft.com/mssql/server:2022-latest
|
|
||||||
container_name: ghadir-db
|
|
||||||
environment:
|
|
||||||
- ACCEPT_EULA=Y
|
|
||||||
- SA_PASSWORD=Ghadir@1403
|
|
||||||
- MSSQL_PID=Express
|
|
||||||
ports:
|
|
||||||
- "1433:1433"
|
|
||||||
volumes:
|
|
||||||
- sqlserver-data:/var/opt/mssql
|
|
||||||
networks:
|
|
||||||
- ghadir-network
|
|
||||||
healthcheck:
|
|
||||||
test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "Ghadir@1403" -C -Q "SELECT 1" || exit 1
|
|
||||||
interval: 10s
|
|
||||||
timeout: 5s
|
|
||||||
retries: 10
|
|
||||||
start_period: 30s
|
|
||||||
|
|
||||||
backend:
|
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@@ -29,19 +9,12 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- ASPNETCORE_ENVIRONMENT=Production
|
- ASPNETCORE_ENVIRONMENT=Production
|
||||||
- ASPNETCORE_URLS=http://+:8080
|
- ASPNETCORE_URLS=http://+:8080
|
||||||
- ConnectionStrings__DefaultConnection=Server=sqlserver;Database=GhadirContestDB;User Id=sa;Password=Ghadir@1403;TrustServerCertificate=True
|
- ConnectionStrings__DefaultConnection=Server=sqlserver,1433;TrustServerCertificate=True;Database=GhadirDb;User Id=sa;Password=qwER12#$110;
|
||||||
ports:
|
|
||||||
- "5000:8080"
|
|
||||||
depends_on:
|
|
||||||
sqlserver:
|
|
||||||
condition: service_healthy
|
|
||||||
networks:
|
networks:
|
||||||
- ghadir-network
|
- services
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
|
||||||
ghadir-network:
|
|
||||||
driver: bridge
|
|
||||||
|
|
||||||
volumes:
|
networks:
|
||||||
sqlserver-data:
|
services:
|
||||||
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user