Compare commits
4 Commits
a44912ac87
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d553d8f373 | |||
| a50bd4cf65 | |||
| 238202c45b | |||
| f49705b70f |
@ -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
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"]
|
||||
@ -4,7 +4,6 @@
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"PERSISTENCE_TYPE": "Sql",
|
||||
"USERSCONFIG_FILE_PATH": "./../../assets/example-users.config",
|
||||
"SQL_CONNECTIONSTRING": ""
|
||||
"CORS_ORIGINS": "",
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
services:
|
||||
messengerapi:
|
||||
image: https://gitea.masita.net/mc/messengerapi:latest
|
||||
container_name: messengerapi
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
17
examples/example-docker-compose.yml
Normal file
17
examples/example-docker-compose.yml
Normal 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
|
||||
Reference in New Issue
Block a user