forked from igorsheg/astro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (19 loc) · 718 Bytes
/
Dockerfile
File metadata and controls
32 lines (19 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.17.3-alpine3.14 AS builder
WORKDIR /app
RUN apk add sqlite yarn gcc libc-dev
COPY . .
RUN cd web && yarn install && NODE_ENV=production yarn build
RUN cd server && go build -o astroserver.sh cmd/astro/main.go
######################################################
FROM alpine:3.14 as prod
WORKDIR /app
COPY --from=builder /app/web/statics ./web/statics
COPY --from=builder /app/web/public ./web/public
COPY --from=builder /app/web/index.html ./web/index.html
COPY --from=builder /app/server/astroserver.sh ./server/astroserver.sh
COPY --from=builder /app/server/data ./server/data
COPY --from=builder /app/.env .
WORKDIR /app/server
ENV GIN_MODE=release
EXPOSE 8088
CMD ["./astroserver.sh"]