Skip to content

Commit

Permalink
fix user + upgrade for security
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrede committed Nov 19, 2024
1 parent dd9895b commit e7575aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ COPY --from=builder /venv /venv
COPY --from=builder /build /app

# Use a non-root user
RUN useradd -m appuser && chown -R appuser /venv /app
RUN set -ex \
# Create a non-root user
&& addgroup --system --gid 1001 appgroup \
&& adduser --system --uid 1001 --gid 1001 --no-create-home appuser \
&& chown -R appuser /venv /app \
# Upgrade the package index and install security upgrades
&& apt-get update \
&& apt-get upgrade -y \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
USER appuser

ENTRYPOINT [ "/venv/bin/fedn" ]
Expand Down

0 comments on commit e7575aa

Please sign in to comment.