Compare commits

..

2 Commits

Author SHA1 Message Date
187b42e465 dependency update
All checks were successful
Build and Push Multi-Arch Docker Image / build-and-push (push) Successful in 11m21s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2025-11-28 22:09:42 +01:00
227311a39e Revert "updated Dockerfile for custom user"
This reverts commit 0e46299ee0.
2025-11-28 22:09:12 +01:00
2 changed files with 2 additions and 18 deletions

View File

@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager"> <component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />

View File

@@ -1,22 +1,13 @@
# Use latest stable channel SDK. # Use latest stable channel SDK.
FROM dart:stable AS build FROM dart:stable AS build
# Set user/group IDs (defaults to 1000:1000)
ARG PUID=1000
ARG PGID=1000
# Create user and group
RUN groupadd -g $PGID appgroup && \
useradd -u $PUID -g $PGID -m appuser
# Resolve app dependencies. # Resolve app dependencies.
WORKDIR /app WORKDIR /app
COPY pubspec.* ./ COPY pubspec.* ./
RUN dart pub get RUN dart pub get
# Copy app source code (except anything in .dockerignore) and AOT compile app. # Copy app source code (except anything in .dockerignore) and AOT compile app.
COPY --chown=$PUID:$PGID . . COPY . .
USER appuser
RUN dart run build_runner build --delete-conflicting-outputs && \ RUN dart run build_runner build --delete-conflicting-outputs && \
APP_VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //') && \ APP_VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //') && \
dart compile exe bin/server.dart -o bin/server \ dart compile exe bin/server.dart -o bin/server \
@@ -25,18 +16,10 @@ RUN dart run build_runner build --delete-conflicting-outputs && \
# Build minimal serving image from AOT-compiled `/server` # Build minimal serving image from AOT-compiled `/server`
# and the pre-built AOT-runtime in the `/runtime/` directory of the base image. # and the pre-built AOT-runtime in the `/runtime/` directory of the base image.
FROM scratch FROM scratch
# Set user/group IDs (defaults to 1000:1000)
ARG PUID=1000
ARG PGID=1000
COPY --from=build /runtime/ / COPY --from=build /runtime/ /
COPY --from=build /app/bin/server /app/bin/ COPY --from=build /app/bin/server /app/bin/
COPY assets /assets COPY assets /assets
# Set user for runtime (using numeric IDs since scratch has no users)
USER $PUID:$PGID
# Start server. # Start server.
EXPOSE 3000 EXPOSE 3000
CMD ["/app/bin/server"] CMD ["/app/bin/server"]