-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
36 lines (26 loc) · 1.09 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
35
36
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
# Install yarn
RUN npm install -g yarn
# Build site
RUN cd embedg-site && yarn install && yarn build && cd ..
# Build app
RUN cd embedg-app && yarn install && yarn build && cd ..
# Build backend
RUN cd embedg-server && go build --tags "embedapp embedsite" && cd ..
FROM debian:stable-slim
WORKDIR /root/
COPY --from=builder /root/embedg-server/embedg-server .
RUN apt-get update
RUN apt-get install -y ca-certificates gnupg build-essential
EXPOSE 8080
CMD ./embedg-server migrate postgres up; ./embedg-server server