Skip to content

Commit a5fa615

Browse files
committed
feat: move caching to gha cache
1 parent d36ac64 commit a5fa615

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

api/Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ WORKDIR /app
88

99
# Cache dependencies separately
1010
COPY go.mod go.sum ./
11-
RUN --mount=type=cache,target=/go/pkg/mod \
12-
go mod download
11+
RUN go mod download
1312

1413
# Copy source code
1514
COPY . .
1615

17-
# Build with cache mounts and cross-compilation
18-
RUN --mount=type=cache,target=/go/pkg/mod \
19-
--mount=type=cache,target=/root/.cache/go-build \
20-
GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
16+
# Build with cross-compilation
17+
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make build
2118

2219
FROM alpine:3.18
2320
ARG API_PORT

view/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ FROM node:18-alpine AS deps
22
RUN apk add --no-cache libc6-compat
33
WORKDIR /app
44
COPY package.json yarn.lock ./
5-
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
6-
yarn install --frozen-lockfile --network-timeout 600000 --production=false
5+
RUN yarn install --frozen-lockfile --network-timeout 600000 --production=false
76

87
FROM node:18-alpine AS builder
98
WORKDIR /app
@@ -15,8 +14,7 @@ ENV NEXT_TELEMETRY_DISABLED=1
1514
ENV PORT=$NEXT_PUBLIC_PORT
1615
ENV NEXT_PUBLIC_PORT=$NEXT_PUBLIC_PORT
1716

18-
RUN --mount=type=cache,target=/app/.next/cache \
19-
yarn build
17+
RUN yarn build
2018

2119
FROM node:18-alpine AS runner
2220
WORKDIR /app

0 commit comments

Comments
 (0)