-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
40 lines (30 loc) · 1.01 KB
/
Dockerfile.dev
File metadata and controls
40 lines (30 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Development Dockerfile with hot reload support
FROM mcr.microsoft.com/dotnet/sdk:8.0
WORKDIR /app
# Install runtime dependencies used in development container
RUN apt-get update && \
apt-get install -y --no-install-recommends \
mediainfo \
ca-certificates \
curl && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean && \
groupadd -r optimarr && \
useradd -r -g optimarr -u 1000 optimarr && \
mkdir -p /app/config /app/data /app/logs && \
mediainfo --Version
# Copy project file and restore dependencies
COPY optimarr.csproj .
RUN dotnet restore
# Copy source
COPY . .
# Ensure app directory is writable by non-root user
RUN chown -R optimarr:optimarr /app
# Keep the internal app port consistent with production
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=1
USER optimarr
# Run with hot reload in development
ENTRYPOINT ["dotnet", "watch", "run", "--no-restore", "--urls", "http://0.0.0.0:8080"]