Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rigon committed Feb 11, 2025
2 parents 3ab411b + 65d2aee commit 369aa95
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 6,463 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v6
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
## FROM --platform=$BUILDPLATFORM
## See more for cross-compile:
## https://dh1tw.de/2019/12/cross-compiling-golang-cgo-projects/
FROM --platform=$TARGETPLATFORM golang:1.18-alpine3.17 AS server
FROM golang:1.18-alpine3.17 AS server
RUN apk update && apk add musl-dev gcc g++ ffmpeg-libs ffmpeg-dev
WORKDIR /app
COPY server/go.mod server/go.sum ./
RUN go mod download -x
COPY server/ ./
ARG TARGETOS TARGETARCH
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=1 go build -v -installsuffix cgo -o photo-gallery
RUN CGO_ENABLED=1 go build -v -o photo-gallery
# RUN GOOS=$TARGETOS GOARCH=$TARGETARCH CGO_ENABLED=1 go build -v -installsuffix cgo -o photo-gallery
# For static compilation (not working): -ldflags '-extldflags "-static"'

# Fronted
FROM --platform=$BUILDPLATFORM node:18-alpine3.17 AS frontend
FROM node:18-alpine3.17 AS frontend
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Deploy
FROM --platform=$TARGETPLATFORM alpine:3.17
FROM alpine:3.17
WORKDIR /app/server
EXPOSE 3080
VOLUME "/photos" "/thumbs"
Expand Down
Loading

0 comments on commit 369aa95

Please sign in to comment.