mirror of
https://github.com/elyby/chrly.git
synced 2024-11-26 16:51:59 +05:30
Fix release pipeline and upgrade Dockerfile
This commit is contained in:
parent
6accffed45
commit
ecbb06b83c
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@ -26,17 +26,21 @@ jobs:
|
|||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ env.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ env.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
26
Dockerfile
26
Dockerfile
@ -1,14 +1,26 @@
|
|||||||
FROM alpine:3.9.3
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
|
FROM golang:1.21-alpine AS builder
|
||||||
|
|
||||||
|
COPY . /build
|
||||||
|
WORKDIR /build
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=0 \
|
||||||
|
go build \
|
||||||
|
-trimpath \
|
||||||
|
-ldflags="-w -s" \
|
||||||
|
-o chrly \
|
||||||
|
main.go
|
||||||
|
|
||||||
|
FROM alpine:3.19
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates
|
|
||||||
|
|
||||||
ENV STORAGE_REDIS_HOST=redis
|
ENV STORAGE_REDIS_HOST=redis
|
||||||
ENV STORAGE_FILESYSTEM_HOST=/data
|
ENV STORAGE_FILESYSTEM_HOST=/data
|
||||||
|
|
||||||
COPY docker-entrypoint.sh /usr/local/bin/
|
COPY docker-entrypoint.sh /
|
||||||
COPY release/chrly /usr/local/bin/
|
COPY --from=builder /build/chrly /usr/local/bin/chrly
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||||
CMD ["serve"]
|
CMD ["serve"]
|
||||||
|
Loading…
Reference in New Issue
Block a user