ops: .dockerignore, non-root user, network isolation, deploy rollback
- .dockerignore excludes .git, node_modules, certs, *.zip - Dockerfile runs as non-root appuser - compose.yml isolates frontend (Caddy only) and backend (DB/cache/media) networks - deploy.sh snapshots binary before pull and rolls back on failed health check
This commit is contained in:
+3
-1
@@ -16,8 +16,10 @@ RUN npm run build
|
||||
|
||||
FROM alpine:latest
|
||||
RUN apk --no-cache add ca-certificates
|
||||
RUN adduser -D -g '' appuser
|
||||
WORKDIR /app
|
||||
COPY --from=go-builder /bin/dumpster-server /app/dumpster-server
|
||||
COPY --from=web-builder /app/dist /srv/web
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
CMD ["sh", "-c", "if [ -z \"$DUMPSTER_SECRET\" ]; then export DUMPSTER_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32); fi; /app/dumpster-server"]
|
||||
CMD sh -c "if [ -z \"$DUMPSTER_SECRET\" ]; then export DUMPSTER_SECRET=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 32); fi; /app/dumpster-server"
|
||||
|
||||
Reference in New Issue
Block a user