Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
71 lines (55 loc) · 2.14 KB
/
Copy pathDockerfile.dev
File metadata and controls
71 lines (55 loc) · 2.14 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# cyberia-server DEV runtime image.
# --- Build Image ---
FROM rockylinux/rockylinux:9 AS builder
RUN dnf -y update && \
dnf -y install epel-release && \
dnf -y install --allowerasing \
git \
make \
golang && \
dnf clean all
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -gcflags="all=-N -l" -o server ./cmd/cyberia-server/ && \
echo "DEV build complete: $(pwd)/server"
# --- Runtime Image ---
FROM rockylinux/rockylinux:9 AS runtime
ARG NODE_VERSION=24.15.0
RUN set -eux; \
dnf -y update; \
dnf -y install epel-release; \
dnf -y install --allowerasing \
curl git tar xz \
procps-ng strace lsof vim-minimal; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) node_arch=x64 ;; \
aarch64) node_arch=arm64 ;; \
*) echo "unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${node_arch}.tar.xz" \
| tar -xJ -C /usr/local --strip-components=1; \
node --version; npm --version; \
dnf clean all
COPY underpost-cli.tgz /tmp/underpost-cli.tgz
RUN set -eux; \
npm install -g /tmp/underpost-cli.tgz --omit=dev; \
rm -f /tmp/underpost-cli.tgz; \
npm cache clean --force; \
underpost --version
WORKDIR /home/dd/engine/cyberia-server
COPY --from=builder /build/server ./server
COPY public/ ./public/
EXPOSE 8081
# Both Data Server endpoints are flags, not environment reads (cmd/cyberia-server/main.go), and
# the server refuses to start without them. Passing them here from the environment is what lets a
# plain `docker run` or a Compose service that sets no command still start: a Kubernetes pod spec
# supplies its own command and overrides this. An empty CYBERIA_PUBLIC_URL keeps the server off
# the Data Server registry.
ENV CYBERIA_DATA_SERVER_URL=http://engine-cyberia
ENV CYBERIA_DATA_SERVER_GRPC=engine-cyberia-runtime:50051
ENV CYBERIA_PUBLIC_URL=
CMD ["sh", "-c", "exec /home/dd/engine/cyberia-server/server --data-server-url=${CYBERIA_DATA_SERVER_URL} --data-server-grpc=${CYBERIA_DATA_SERVER_GRPC}"]