forked from JordanKnott/taskcafe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (21 loc) · 706 Bytes
/
Dockerfile
File metadata and controls
23 lines (21 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM node:20-alpine AS frontend
RUN apk --no-cache add curl
WORKDIR /usr/src/app
COPY frontend .
RUN yarn install --frozen-lockfile
RUN yarn build
FROM golang:1.22-alpine AS backend
RUN apk --no-cache add git gcc musl-dev
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=frontend /usr/src/app/build ./frontend/build
# Regenerate GraphQL schema from .gql sources, embed migrations + frontend, build binary
RUN go run cmd/mage/main.go backend:schema backend:genFrontend backend:genMigrations backend:build
FROM alpine:3.19
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /root/
COPY --from=backend /usr/src/app/dist/taskcafe .
EXPOSE 3333
CMD ["./taskcafe", "web"]