Files
warpbox-dev/Dockerfile
Daniel Legt 33d26804a0
All checks were successful
Build and Publish Docker Image / deploy (push) Successful in 1m38s
feat: add Docker support and Gitea publish workflow
- Add a multi-stage Dockerfile for building and running the Go backend
- Add .dockerignore to optimize the Docker build context
- Create a Gitea Actions workflow to build and publish Docker images on tag push
- Register a new `/health` endpoint for container healthchecks
- Update README.md with Docker and Podman deployment instructions
- Ignore local `docker-compose.yml` in .gitignore
2026-05-30 14:36:02 +03:00

41 lines
854 B
Docker

FROM golang:1.26-alpine AS builder
WORKDIR /src/backend
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend/ ./
ARG APP_VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w -X main.version=${APP_VERSION}" \
-o /out/warpbox \
./cmd/warpbox
FROM alpine:3.22
RUN apk add --no-cache ca-certificates ffmpeg wget
ENV WARPBOX_ADDR=:8080 \
WARPBOX_DATA_DIR=/data \
WARPBOX_STATIC_DIR=/app/static \
WARPBOX_TEMPLATE_DIR=/app/templates
WORKDIR /app
COPY --from=builder /out/warpbox /usr/local/bin/warpbox
COPY backend/static /app/static
COPY backend/templates /app/templates
RUN mkdir -p /data
EXPOSE 8080
VOLUME ["/data"]
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD wget -qO- http://127.0.0.1:8080/health >/dev/null || exit 1
ENTRYPOINT ["warpbox"]