there we go
Some checks failed
Build / build (push) Has been cancelled

This commit is contained in:
Gustavo Maronato 2023-08-24 22:44:03 -03:00
parent 949ea57dd9
commit 7499aea5cc
Signed by: maronato
SSH Key Fingerprint: SHA256:2Gw7kwMz/As+2UkR1qQ/qYYhn+WNh3FGv6ozhoRrLcs
2 changed files with 10 additions and 5 deletions

View File

@ -22,14 +22,15 @@ ENV ENV_DOCKER=true
# Copy dockerignore files
COPY .dockerignore ./
COPY Makefile ./
# Install go deps using the cache
COPY go.mod go.sum Makefile ./
RUN --mount=type=cache,target=/go/pkg/mod/ \
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/tmp/.go-build-cache \
go mod download -x
# Install node deps
COPY frontend/package.json frontend/package-lock.json frontend/
# Set npm cache to /tmp/.npm-cache
RUN npm config set cache /tmp/.npm-cache --global
RUN --mount=type=cache,target=/tmp/.npm-cache \
make install
@ -38,8 +39,12 @@ RUN --mount=type=cache,target=/tmp/.npm-cache \
COPY frontend frontend
RUN make frontend
# Build backend
COPY goshort.go ./
COPY cmd cmd
COPY internal internal
# Build the backend
COPY . .
RUN --mount=type=cache,target=/tmp/.go-build-cache \
make backend

View File

@ -7,7 +7,7 @@ frontend:
VITE_API_URL=/api npm run --prefix frontend build
backend:
go build -o goshort goshort.go
CGO_ENABLED=0 go build -o goshort goshort.go
all:
make frontend