Skip to content

Commit

Permalink
Added the Dockers
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcc committed Nov 24, 2023
1 parent 983c663 commit ecae143
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ builds:
- linux_amd64
- linux_arm64
- linux_arm_5
- id: cloudcore-server
main: ./cmd/cloudcore-server
binary: cloudcore
ldflags:
- -s -w -X github.com/clarkmcc/cloudcore/pkg/version.Version={{.Version}} -X github.com/clarkmcc/cloudcore/pkg/version.Hash={{.Commit}}
env:
- CGO_ENABLED=0
targets:
- linux_amd64
nfpms:
- id: cloudcored-linux
package_name: cloudcored
Expand All @@ -30,4 +39,14 @@ nfpms:
# preremove: scripts/linux/preremove.sh
# postremove: scripts/linux/postremove.sh
# Whether to enable the size reporting or not.
report_sizes: true

dockers:
# Server
- id: cloudcore-server
goos: linux
goarch: amd64
ids:
- cloudcore-server
dockerfile: ./cmd/cloudcore-server/Dockerfile

report_sizes: true
20 changes: 20 additions & 0 deletions cmd/cloudcore-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM golang:1.21-alpine AS builder

WORKDIR /root

COPY go.mod /root/go.mod
COPY go.sum /root/go.sum
RUN go mod download

COPY cmd /root/cmd
COPY pkg /root/pkg
COPY app/backend /root/app/backend
COPY internal /root/internal

RUN go build -o cloudcore ./cmd/cloudcore-server

FROM alpine:latest AS runtime

COPY --from=builder /root/cloudcore /usr/bin/cloudcore

ENTRYPOINT ["cloudcore"]

0 comments on commit ecae143

Please sign in to comment.