some changes
This commit is contained in:
55
Dockerfile
Normal file
55
Dockerfile
Normal file
@@ -0,0 +1,55 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
##
|
||||
## Build Backend
|
||||
##
|
||||
FROM golang:1.18-buster AS build_backend
|
||||
ENV GO111MODULE=on \
|
||||
CGO_ENABLE=1 \
|
||||
GOOS=linux \
|
||||
GOARCH=amd64
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go mod download
|
||||
RUN apt update && apt install -y ca-certificates
|
||||
|
||||
COPY *.go ./
|
||||
COPY auth/. auth/.
|
||||
COPY controllers/. controllers/.
|
||||
COPY models/. models/.
|
||||
COPY server/. server/.
|
||||
|
||||
RUN go build -a --installsuffix cgo -v -tags netgo -ldflags '-extldflags "-static"' -o /main .
|
||||
|
||||
##
|
||||
## Build Frontend
|
||||
##
|
||||
FROM node:16 AS build_frontend
|
||||
WORKDIR /usr/src/app
|
||||
RUN npm install -g pnpm
|
||||
|
||||
COPY assets/package.json ./
|
||||
COPY assets/pnpm-lock.yaml ./
|
||||
|
||||
RUN pnpm i
|
||||
|
||||
COPY assets/. .
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
##
|
||||
## Deploy
|
||||
##
|
||||
FROM scratch
|
||||
LABEL maintainer="Jasper Spahl <jasperspahl@web.de>"
|
||||
|
||||
ENV WOKABLE_MODE="release"
|
||||
WORKDIR /
|
||||
COPY --from=build_backend /main ./
|
||||
COPY --from=build_frontend /usr/src/app/dist/. assets/dist/.
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT [ "/main" ]
|
||||
Reference in New Issue
Block a user