-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: adjust docker build to pass the frontend artifacts
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
FROM node:20-alpine AS web-build | ||
|
||
WORKDIR /build | ||
COPY ./web/package.json . | ||
RUN npm install | ||
COPY ./web . | ||
RUN npm run build | ||
|
||
FROM golang:1.22.1-alpine AS build | ||
|
||
WORKDIR /build | ||
# TODO: exclude web files using --exclude when available in stable syntax | ||
# https://docs.docker.com/reference/dockerfile/#copy---exclude | ||
COPY . . | ||
COPY --from=web-build /build/dist ./web/dist | ||
RUN go mod download | ||
RUN go build -o undershorts ./cmd/undershorts/main.go | ||
|
||
FROM alpine:3 AS final | ||
|
||
WORKDIR /app | ||
COPY --from=build /build/undershorts . | ||
COPY --from=build /build/web ./web | ||
|
||
CMD [ "/app/undershorts" ] |