added docker for deployment and README for how to

This commit is contained in:
BeatriceAl
2026-05-11 22:01:37 +02:00
parent b5d1f40dca
commit 420bb8a4f9
4 changed files with 125 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
.git/
.idea/
.vs/
.vscode/
**/bin/
**/obj/
**/TestResults/
**/coverage/
*.user
*.suo
*.log
.env
.env.*
Dockerfile
docker-compose.yml
README.md
+22
View File
@@ -0,0 +1,22 @@
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY Guestlist.sln ./
COPY Guestlist/Guestlist.csproj Guestlist/
RUN dotnet restore Guestlist.sln
COPY Guestlist/ Guestlist/
RUN dotnet publish Guestlist/Guestlist.csproj \
--configuration Release \
--no-restore \
--output /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
COPY --from=build /app/publish ./
ENTRYPOINT ["dotnet", "Guestlist.dll"]
+55
View File
@@ -0,0 +1,55 @@
# Guestlist
Minimale Guestlist-App mit Admin/Maintainer-Login, Guest-Access-Code und MongoDB.
## Schnellstart mit Docker Compose
```bash
docker compose up -d --build
```
App öffnen:
```text
http://localhost:8080
```
Beim ersten Start:
```text
http://localhost:8080/setup
```
Dort den ersten Admin und den Guest Access Code anlegen.
## Nützliche Befehle
Logs anzeigen:
```bash
docker compose logs -f app
```
Stoppen:
```bash
docker compose down
```
Stoppen und MongoDB-Daten löschen:
```bash
docker compose down -v
```
## Konfiguration
Die App wird im Container über Environment Variables konfiguriert:
```yaml
Mongo__ConnectionString: mongodb://mongo:27017
Mongo__DatabaseName: guestlist
ASPNETCORE_URLS: http://+:8080
```
MongoDB-Daten liegen im Compose-Volume `mongo_data`.
+28
View File
@@ -0,0 +1,28 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: guestlist-app
restart: unless-stopped
ports:
- "8080:8080"
environment:
ASPNETCORE_ENVIRONMENT: Production
ASPNETCORE_URLS: http://+:8080
Mongo__ConnectionString: mongodb://mongo:27017
Mongo__DatabaseName: guestlist
depends_on:
- mongo
mongo:
image: mongo:7
container_name: guestlist-mongo
restart: unless-stopped
volumes:
- mongo_data:/data/db
ports:
- "27017:27017"
volumes:
mongo_data: