Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**/bin/
**/obj/

.git/
.github/

.vscode/
.idea/

*.user
*.suo

.DS_Store

tests/

README.md
.gitignore
50 changes: 50 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -------------------------
# Build stage
# -------------------------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build

WORKDIR /src

COPY ["src/TransitPulse.API/TransitPulse.API.csproj", "src/TransitPulse.API/"]
COPY ["src/TransitPulse.Application/TransitPulse.Application.csproj", "src/TransitPulse.Application/"]
COPY ["src/TransitPulse.Domain/TransitPulse.Domain.csproj", "src/TransitPulse.Domain/"]
COPY ["src/TransitPulse.Infrastructure/TransitPulse.Infrastructure.csproj", "src/TransitPulse.Infrastructure/"]

RUN dotnet restore "src/TransitPulse.API/TransitPulse.API.csproj"

COPY . .

WORKDIR "/src/src/TransitPulse.API"

RUN dotnet build "TransitPulse.API.csproj" \
--configuration Release \
--no-restore \
--output /app/build


# -------------------------
# Publish stage
# -------------------------
FROM build AS publish

RUN dotnet publish "TransitPulse.API.csproj" \
--configuration Release \
--no-restore \
--output /app/publish \
/p:UseAppHost=false


# -------------------------
# Runtime stage
# -------------------------
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final

WORKDIR /app

COPY --from=publish /app/publish .

EXPOSE 8080

ENV ASPNETCORE_HTTP_PORTS=8080

ENTRYPOINT ["dotnet", "TransitPulse.API.dll"]
40 changes: 40 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
services:
postgres:
image: postgres:17
container_name: transitpulse-postgres
environment:
POSTGRES_DB: transitpulse
POSTGRES_USER: transitpulse
POSTGRES_PASSWORD: transitpulse_dev_password
ports:
- "5432:5432"
volumes:
- transitpulse-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U transitpulse -d transitpulse"]
interval: 5s
timeout: 5s
retries: 10

api:
build:
context: .
dockerfile: Dockerfile
image: transitpulse-api:local
container_name: transitpulse-api
depends_on:
postgres:
condition: service_healthy
environment:
ASPNETCORE_ENVIRONMENT: Development
ASPNETCORE_HTTP_PORTS: "8080"
ConnectionStrings__TransitPulseDb: "Host=postgres;Port=5432;Database=transitpulse;Username=transitpulse;Password=transitpulse_dev_password"
Jwt__SecretKey: "TransitPulse-Docker-Development-Secret-Key-2026"
Jwt__Issuer: "TransitPulse"
Jwt__Audience: "TransitPulseUsers"
Jwt__ExpiryMinutes: "60"
ports:
- "8080:8080"

volumes:
transitpulse-postgres-data:
Loading