mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-31 14:58:22 -04:00
Update dockerfile
This commit is contained in:
parent
506bc0176b
commit
57eb32d9c0
1 changed files with 13 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Build
|
# -- Build
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
|
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
@ -15,24 +15,30 @@ RUN dotnet publish DiscordChatExporter.Cli \
|
||||||
--configuration Release \
|
--configuration Release \
|
||||||
--output ./publish
|
--output ./publish
|
||||||
|
|
||||||
# Run
|
# -- Run
|
||||||
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine
|
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine
|
||||||
|
|
||||||
# tzdata is needed for DateTimeOffset.ToLocalTime (for TimeZoneInfo.Local, to be precise)
|
# Alpine dotnet image doesn't include timezone data, which is needed
|
||||||
|
# for certain date/time operations.
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
|
# Create a non-root user to run the app, so that the output files
|
||||||
|
# can be accessed by the host.
|
||||||
|
# https://github.com/Tyrrrz/DiscordChatExporter/issues/851
|
||||||
RUN adduser \
|
RUN adduser \
|
||||||
--disabled-password \
|
--disabled-password \
|
||||||
--no-create-home \
|
--no-create-home \
|
||||||
dce
|
dce
|
||||||
|
|
||||||
USER dce
|
USER dce
|
||||||
COPY --from=build /build/publish /opt/discord_chat_exporter
|
|
||||||
|
COPY --from=build /build/publish /opt/dce
|
||||||
|
|
||||||
# Need to keep this as /out for backwards compatibility with documentation.
|
# Need to keep this as /out for backwards compatibility with documentation.
|
||||||
# A lot of people have this directory mounted in their scripts files, so
|
# A lot of people have this directory mounted in their scripts files, so
|
||||||
# changing it would break existing workflows.
|
# changing it would break existing workflows.
|
||||||
WORKDIR /out
|
WORKDIR /out
|
||||||
|
|
||||||
# Having it in PATH is convenient for interactive shell sessions,
|
# Add the app directory to PATH so that it's easier to debug using a shell
|
||||||
# which may be useful for debugging.
|
ENV PATH="$PATH:/opt/dce"
|
||||||
ENV PATH="$PATH:/opt/discord_chat_exporter"
|
|
||||||
ENTRYPOINT ["DiscordChatExporter.Cli"]
|
ENTRYPOINT ["DiscordChatExporter.Cli"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue