diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a4bda1a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +statuspherego +database.db +.env +example.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5fe888a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM golang:alpine AS builder + +WORKDIR /app + +COPY . . +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 go build -o statusphere-go ./cmd/main.go + +FROM alpine:latest + +RUN apk --no-cache add ca-certificates + +WORKDIR /app/ +COPY --from=builder /app/statusphere-go . + +ENTRYPOINT ["./statusphere-go"] diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..0b99e5b --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,12 @@ +services: + statusphere-go: + platform: linux/amd64 + container_name: statusphere-go + image: willdot/statusphere-go:latest + environment: + ENV_LOCATION: "/app/data/statusphere-go.env" + volumes: + - ./data:/app/data + ports: + - "3005:3005" + restart: always