Skip to content

Commit

Permalink
Fix release pipeline and upgrade Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
erickskrauch committed Dec 12, 2023
1 parent 6accffe commit ecbb06b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,21 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}

- name: Build and Push
uses: docker/build-push-action@v5
with:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
FROM alpine:3.9.3
# syntax=docker/dockerfile:1

EXPOSE 80
FROM golang:1.21-alpine AS builder

COPY . /build
WORKDIR /build
RUN go mod download

RUN apk add --no-cache ca-certificates
RUN CGO_ENABLED=0 \
go build \
-trimpath \
-ldflags="-w -s" \
-o chrly \
main.go

FROM alpine:3.19

EXPOSE 80
ENV STORAGE_REDIS_HOST=redis
ENV STORAGE_FILESYSTEM_HOST=/data

COPY docker-entrypoint.sh /usr/local/bin/
COPY release/chrly /usr/local/bin/
COPY docker-entrypoint.sh /
COPY --from=builder /build/chrly /usr/local/bin/chrly

ENTRYPOINT ["docker-entrypoint.sh"]
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["serve"]

0 comments on commit ecbb06b

Please sign in to comment.