finalized Dockerfile
This commit is contained in:
parent
2fc021ac4f
commit
3534cbf3cd
2 changed files with 35 additions and 0 deletions
6
.dockerignore
Normal file
6
.dockerignore
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
node_modules
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
*.md
|
||||||
|
build
|
||||||
|
tmp
|
||||||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
FROM node:20-alpine AS styles
|
||||||
|
ENV PNPM_HOME="/pnpm"
|
||||||
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
RUN corepack enable
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
||||||
|
RUN pnpm run tw:prod
|
||||||
|
|
||||||
|
FROM golang:1.22.0 as builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY *.go ./
|
||||||
|
|
||||||
|
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ./build/potoforio .
|
||||||
|
|
||||||
|
FROM alpine as runner
|
||||||
|
WORKDIR /go
|
||||||
|
COPY --from=builder /app/build/potoforio ./
|
||||||
|
COPY --from=styles /app/static ./static
|
||||||
|
COPY --from=styles /app/views ./views
|
||||||
|
|
||||||
|
EXPOSE 5173
|
||||||
|
|
||||||
|
ENV GO_ENV="production"
|
||||||
|
|
||||||
|
ENTRYPOINT ["./potoforio"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue