Compare commits

...

4 Commits

Author SHA1 Message Date
d553d8f373 Added examples.
All checks were successful
Build and Push Docker Image / docker (push) Successful in 8s
2025-07-06 16:03:01 +02:00
a50bd4cf65 Removed compose/docker steps as Portainer CE doesn't allow automating deployments.
All checks were successful
Build and Push Docker Image / docker (push) Successful in 31s
2025-07-06 15:47:16 +02:00
238202c45b Redeploy bug fix.
All checks were successful
Build and Push Docker Image / build (push) Successful in 53s
Build and Push Docker Image / docker (push) Successful in 8s
2025-07-06 10:34:53 +02:00
f49705b70f Fixed a bug and added redeploy step.
Some checks failed
Build and Push Docker Image / build (push) Successful in 53s
Build and Push Docker Image / docker (push) Failing after 36s
2025-07-06 10:30:31 +02:00
8 changed files with 22 additions and 44 deletions

View File

@ -1,26 +0,0 @@
name: Build and Push Docker Image
on:
push:
jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/dotnet/sdk:9.0
steps:
- name: Install Node.js and dependencies
run: |
apt-get update
apt-get install -y curl gnupg
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs git
- name: Checkout
uses: actions/checkout@v3
- name: Restore dependencies
run: dotnet restore ./code/MessengerApi/MessengerApi.csproj
- name: Build project
run: dotnet build ./code/MessengerApi/MessengerApi.csproj -c Release

View File

@ -6,6 +6,11 @@ namespace MessengerApi.Configuration.Parsers
{
public static PersistenceTypes Parse(string value)
{
if (string.IsNullOrWhiteSpace(value))
{
return PersistenceTypes.Sql;
}
return (PersistenceTypes)Enum.Parse(typeof(PersistenceTypes), value, true);
}
}

View File

@ -28,7 +28,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
ProjectSection(SolutionItems) = preProject
..\Directory.Packages.props = ..\Directory.Packages.props
..\docker-compose.yml = ..\docker-compose.yml
..\Dockerfile = ..\Dockerfile
..\assets\example-users.config = ..\assets\example-users.config
..\NuGet.config = ..\NuGet.config
@ -36,7 +35,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
..\.gitea\workflows\build.yml = ..\.gitea\workflows\build.yml
..\.gitea\workflows\docker-build-and-push.yml = ..\.gitea\workflows\docker-build-and-push.yml
EndProjectSection
EndProject

View File

@ -1,8 +0,0 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
COPY ./publish .
ENTRYPOINT ["dotnet", "MessengerApi.dll"]

View File

@ -4,7 +4,6 @@
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"PERSISTENCE_TYPE": "Sql",
"USERSCONFIG_FILE_PATH": "./../../assets/example-users.config",
"SQL_CONNECTIONSTRING": ""
"CORS_ORIGINS": "",

View File

@ -1,7 +0,0 @@
services:
messengerapi:
image: https://gitea.masita.net/mc/messengerapi:latest
container_name: messengerapi
restart: unless-stopped
environment:
- ASPNETCORE_ENVIRONMENT=Production

View File

@ -0,0 +1,17 @@
services:
messengerapi:
image: gitea.masita.net/mc/messengerapi:latest
container_name: messengerapi
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- 8080:8080
restart: always
volumes:
- /mnt/config/users.conf:/app/users.conf:ro
environment:
- SQL_CONNECTIONSTRING
- CORS_ORIGINS