-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
36 lines (34 loc) · 1 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 node:14 AS frontend
WORKDIR /app/frontend
COPY web .
RUN npm install
RUN npm run build:release
FROM alpine:3.18 as backend
ENV GO_VERSION 1.21.1
ENV CGO_ENABLED=1
ENV GOPROXY=https://goproxy.cn
WORKDIR /app/backend
COPY ./ ./
COPY --from=frontend /app/frontend/dist ./static
RUN set -eux; \
apk add --no-cache bash ca-certificates curl gcc libc-dev; \
OS=$(uname -s | tr '[:upper:]' '[:lower:]') && \
ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') && \
if [ "$ARCH" = "x86_64" ]; then \
TARGET="go$GO_VERSION.linux-amd64.tar.gz"; \
elif [ "$ARCH" = "aarch64" ]; then \
TARGET="go$GO_VERSION.linux-arm64.tar.gz"; \
else \
exit 1; \
fi; \
wget -O go.tgz https://go.dev/dl/$TARGET; \
tar -C /usr/local -xzf go.tgz; \
export PATH="/usr/local/go/bin:$PATH"; \
chmod a+x build.sh; \
bash build.sh docker
FROM alpine:3.18
WORKDIR /app
COPY --from=backend /app/backend/dbland .
COPY config.yaml README.md LICENSE ./
EXPOSE 2023
CMD ./dbland start -p 2023