You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
memos/Dockerfile

32 lines
586 B
Docker

3 years ago
# Build frontend dist.
FROM node:14.18.2-alpine3.14 AS frontend
WORKDIR /frontend-build
COPY ./web/ .
RUN yarn
RUN yarn build
# Build backend exec file.
FROM golang:1.16.12-alpine3.15 AS backend
WORKDIR /backend-build
RUN apk --no-cache add gcc musl-dev
COPY . .
RUN go build \
-o memos \
./bin/server/main.go
3 years ago
# Make workspace with above generated files.
FROM alpine:3.14.3 AS monolithic
WORKDIR /usr/local/memos
COPY --from=backend /backend-build/memos /usr/local/memos/
COPY --from=frontend /frontend-build/dist /usr/local/memos/web/dist
CMD ["./memos"]
EXPOSE 8080