mirror of
https://github.com/elyby/chrly.git
synced 2024-11-23 05:33:18 +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}}
|
||||
|
||||
- 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
|
||||
|
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
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
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"]
|
||||
|
Loading…
Reference in New Issue
Block a user