mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:26:39 +00:00
run api with docker
This commit is contained in:
@@ -7,3 +7,5 @@ obj
|
||||
log*
|
||||
Content/
|
||||
.env
|
||||
tiles/
|
||||
ready/
|
||||
@@ -0,0 +1,24 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
WORKDIR /src
|
||||
COPY ["SatelliteProvider.Api/SatelliteProvider.Api.csproj", "SatelliteProvider.Api/"]
|
||||
COPY ["SatelliteProvider.Common/SatelliteProvider.Common.csproj", "SatelliteProvider.Common/"]
|
||||
COPY ["SatelliteProvider.DataAccess/SatelliteProvider.DataAccess.csproj", "SatelliteProvider.DataAccess/"]
|
||||
COPY ["SatelliteProvider.Services/SatelliteProvider.Services.csproj", "SatelliteProvider.Services/"]
|
||||
RUN dotnet restore "SatelliteProvider.Api/SatelliteProvider.Api.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/SatelliteProvider.Api"
|
||||
RUN dotnet build "SatelliteProvider.Api.csproj" -c Release -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "SatelliteProvider.Api.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "SatelliteProvider.Api.dll"]
|
||||
|
||||
@@ -16,6 +16,25 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: SatelliteProvider.Api/Dockerfile
|
||||
container_name: satellite-provider-api
|
||||
ports:
|
||||
- "18980:8080"
|
||||
- "18981:8081"
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://+:8080
|
||||
- ConnectionStrings__DefaultConnection=Host=postgres;Port=5432;Database=satelliteprovider;Username=postgres;Password=postgres
|
||||
volumes:
|
||||
- ./tiles:/app/tiles
|
||||
- ./ready:/app/ready
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user