mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2026-01-27 21:20:53 +01:00
feat: add Docker deployment support
This commit is contained in:
60
Dockerfile.parser
Normal file
60
Dockerfile.parser
Normal file
@@ -0,0 +1,60 @@
|
||||
# =============================================================================
|
||||
# Profilarr Parser Dockerfile
|
||||
# =============================================================================
|
||||
# .NET 8.0 microservice for parsing release titles
|
||||
# This service is OPTIONAL - only needed for custom format/quality profile testing
|
||||
#
|
||||
# Build: docker build -f Dockerfile.parser -t profilarr-parser .
|
||||
# Run: docker run -p 5000:5000 profilarr-parser
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Stage 1: Build
|
||||
# -----------------------------------------------------------------------------
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Copy project file first for better layer caching
|
||||
COPY src/services/parser/Parser.csproj ./
|
||||
RUN dotnet restore
|
||||
|
||||
# Copy source and build
|
||||
COPY src/services/parser/ ./
|
||||
RUN dotnet publish -c Release -o /app --no-restore
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Stage 2: Runtime
|
||||
# -----------------------------------------------------------------------------
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
|
||||
|
||||
# Labels for container metadata
|
||||
LABEL org.opencontainers.image.title="Profilarr Parser"
|
||||
LABEL org.opencontainers.image.description="Release title parser for Profilarr (optional)"
|
||||
LABEL org.opencontainers.image.source="https://github.com/Dictionarry-Hub/profilarr"
|
||||
LABEL org.opencontainers.image.licenses="AGPL-3.0"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy built application
|
||||
COPY --from=builder /app ./
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -g 1000 parser && \
|
||||
adduser -u 1000 -G parser -D -h /app parser
|
||||
|
||||
# Switch to non-root user
|
||||
USER parser
|
||||
|
||||
# Environment variables
|
||||
ENV ASPNETCORE_URLS=http://+:5000
|
||||
ENV ASPNETCORE_ENVIRONMENT=Production
|
||||
|
||||
# Expose port
|
||||
EXPOSE 5000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD wget -qO- http://localhost:5000/health || exit 1
|
||||
|
||||
# Run the application
|
||||
ENTRYPOINT ["dotnet", "Parser.dll"]
|
||||
Reference in New Issue
Block a user