-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
34 lines (32 loc) · 1.23 KB
/
Dockerfile
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
31
32
33
34
FROM node:16-alpine AS client-build
RUN apk add --update --no-cache openjdk8-jre-base
WORKDIR /github.com/traPtitech/Emoine/client
COPY ./client/package*.json ./
COPY ./client/scripts ./scripts
COPY ./docs ../docs
RUN npm ci --unsafe-perm
COPY ./client .
ARG HOST
RUN HOST=$HOST npm run build
FROM golang:1.17-alpine AS server-build
RUN apk add --update --no-cache git curl make protoc
WORKDIR /go/src/github.com/traPtitech/Emoine
COPY ./go.* ./
RUN go mod download
RUN go install github.com/golang/protobuf/protoc-gen-go@latest
RUN mkdir -p ./router/handler
COPY . .
RUN make proto
RUN go build
FROM alpine:3.15.0
WORKDIR /app
RUN apk --update --no-cache add tzdata ca-certificates openssl && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
rm -rf /var/cache/apk/*
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
COPY --from=client-build /github.com/traPtitech/Emoine/client/dist ./web/dist
COPY --from=server-build /go/src/github.com/traPtitech/Emoine ./
ENTRYPOINT ./Emoine