-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
.sonarqube | ||
[oO]bj | ||
[bB]in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
# STAGE 1: Build Environment | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env | ||
WORKDIR /src | ||
|
||
ARG NUGET_API_KEY | ||
|
||
# Copy the project files first for better layer caching (if only code changes) | ||
COPY . ./ | ||
|
||
# Add the custom NuGet source | ||
RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json --name github --username trumpee --password $NUGET_API_KEY --store-password-in-clear-text | ||
RUN dotnet nuget add source https://nuget.pkg.github.com/trumpee/index.json \ | ||
--name github \ | ||
--username trumpee \ | ||
--password $NUGET_API_KEY \ | ||
--store-password-in-clear-text | ||
|
||
# Restore NuGet packages from both sources | ||
RUN dotnet restore Gateway.sln --source "https://api.nuget.org/v3/index.json" --source "https://nuget.pkg.github.com/trumpee/index.json" | ||
RUN dotnet restore Gateway.sln \ | ||
--source "https://api.nuget.org/v3/index.json" \ | ||
--source "https://nuget.pkg.github.com/trumpee/index.json" | ||
|
||
# Build the solution | ||
RUN dotnet build Gateway.sln -c Release | ||
RUN dotnet build Gateway.sln -c Debug | ||
RUN dotnet publish ./src/Api/Api.csproj -c Debug -o /app | ||
|
||
# Publish the Api project only (assuming this is the main entry point) | ||
RUN dotnet publish ./src/Api/Api.csproj -c Release -o /app | ||
|
||
# STAGE 2: Runtime Environment | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine | ||
WORKDIR /app | ||
COPY --from=build-env /app . | ||
|
||
# Expose the port your application listens on (replace 80 if needed) | ||
EXPOSE 80 | ||
|
||
# Define the entry point for your application | ||
ENTRYPOINT ["dotnet", "Api.dll"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: "3" | ||
services: | ||
sonarqube: | ||
image: sonarqube:community | ||
container_name: sonarqube | ||
depends_on: | ||
- db | ||
environment: | ||
SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar | ||
SONAR_JDBC_USERNAME: sonar | ||
SONAR_JDBC_PASSWORD: sonar | ||
volumes: | ||
- sonarqube_data:/opt/sonarqube/data | ||
- sonarqube_extensions:/opt/sonarqube/extensions | ||
- sonarqube_logs:/opt/sonarqube/logs | ||
ports: | ||
- "9000:9000" | ||
db: | ||
image: postgres:13 | ||
hostname: postgresql | ||
container_name: postgresql | ||
environment: | ||
POSTGRES_USER: sonar | ||
POSTGRES_PASSWORD: sonar | ||
POSTGRES_DB: sonar | ||
volumes: | ||
- postgresql:/var/lib/postgresql | ||
- postgresql_data:/var/lib/postgresql/data | ||
|
||
sonar-scanner: | ||
container_name: sonar-scanner | ||
image: newtmitch/sonar-scanner | ||
networks: | ||
- sonarnet | ||
volumes: | ||
- ./:/usr/src | ||
depends_on: | ||
- sonarqube | ||
|
||
networks: | ||
sonarnet: | ||
|
||
volumes: | ||
sonarqube_conf: | ||
sonarqube_data: | ||
sonarqube_logs: | ||
sonarqube_extensions: | ||
sonarqube_bundled-plugins: | ||
postgresql: | ||
postgresql_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Error", | ||
"Microsoft.AspNetCore": "Error", | ||
"Default": "Trace", | ||
"Microsoft.AspNetCore": "Trace", | ||
"Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware": "None" | ||
} | ||
}, | ||
"AllowedHosts": "*", | ||
"MongoDb": { | ||
"DatabaseName": "trumpee", | ||
"ConnectionString": "mongodb://root:password@localhost:23001/" | ||
"ConnectionString": "mongodb://root:password@trumpee_mongodb:27017/" | ||
}, | ||
"MassTransit": { | ||
"Transport": { | ||
"Host": "127.0.0.1", | ||
"Host": "trumpee_rabbitmq", | ||
"VHost": "/", | ||
"Username": "guest", | ||
"Password": "guest", | ||
"Port": 23501 | ||
"Port": 5672 | ||
} | ||
} | ||
} |