-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (24 loc) · 1.04 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
FROM golang:latest as builder
WORKDIR /root/
COPY . .
# Install NodeJS (https://github.com/nodesource/distributions#installation-instructions)
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg build-essential
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get -y install nodejs
# Build website
ENV OUTPUT=export
ENV NEXT_PUBLIC_API_PUBLIC_BASE_URL=""
RUN cd kite-web && npm install && npm run build && cd ..
# Build backend
RUN cd kite-service && go build --tags "embedweb" && cd ..
FROM debian:stable-slim
WORKDIR /root/
COPY --from=builder /root/kite-service/kite-service .
RUN apt-get update
RUN apt-get install -y ca-certificates gnupg build-essential
EXPOSE 8080
CMD ./kite-service database migrate postgres up; ./kite-service server start