2023-03-29 07:04:10 +07:00
|
|
|
FROM golang:1.20 AS builder
|
2023-03-27 04:22:25 +07:00
|
|
|
|
2023-03-28 04:04:42 +07:00
|
|
|
COPY serial/ /src/serial/
|
|
|
|
WORKDIR /src/serial
|
2023-04-12 01:29:09 +07:00
|
|
|
|
|
|
|
RUN go get -d -v golang.org/x/net/html
|
|
|
|
RUN go get -d -v github.com/gorilla/mux
|
2023-03-28 04:04:42 +07:00
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main .
|
2023-03-27 04:22:25 +07:00
|
|
|
|
2023-04-14 20:02:40 +07:00
|
|
|
FROM debian:bookworm-20230411-slim
|
2019-03-11 14:35:19 +07:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get -y upgrade && \
|
|
|
|
apt-get --no-install-recommends -y install \
|
2023-04-02 13:28:31 +07:00
|
|
|
curl \
|
|
|
|
cpio \
|
2023-03-30 08:16:32 +07:00
|
|
|
wget \
|
2023-04-15 05:32:17 +07:00
|
|
|
fdisk \
|
2023-03-30 08:16:32 +07:00
|
|
|
unzip \
|
|
|
|
procps \
|
2023-04-03 02:37:31 +07:00
|
|
|
dnsmasq \
|
|
|
|
iptables \
|
2023-04-02 08:57:02 +07:00
|
|
|
iproute2 \
|
2023-03-30 08:16:32 +07:00
|
|
|
xz-utils \
|
2023-04-02 08:57:02 +07:00
|
|
|
btrfs-progs \
|
2023-04-03 02:37:31 +07:00
|
|
|
bridge-utils \
|
2023-03-30 08:16:32 +07:00
|
|
|
netcat-openbsd \
|
2023-04-02 08:57:02 +07:00
|
|
|
ca-certificates \
|
2023-03-30 08:16:32 +07:00
|
|
|
qemu-system-x86 \
|
2019-03-11 14:35:19 +07:00
|
|
|
&& apt-get clean
|
|
|
|
|
2023-04-16 18:33:42 +07:00
|
|
|
COPY run/*.sh /run/
|
|
|
|
COPY agent/*.sh /agent/
|
2023-03-30 23:18:41 +07:00
|
|
|
|
2023-03-28 04:04:42 +07:00
|
|
|
COPY --from=builder /src/serial/main /run/serial.bin
|
2019-03-11 14:35:19 +07:00
|
|
|
|
2023-03-27 01:29:21 +07:00
|
|
|
RUN ["chmod", "+x", "/run/run.sh"]
|
2023-03-28 00:21:49 +07:00
|
|
|
RUN ["chmod", "+x", "/run/server.sh"]
|
2023-04-02 01:13:17 +07:00
|
|
|
RUN ["chmod", "+x", "/run/serial.bin"]
|
2023-03-27 01:29:21 +07:00
|
|
|
|
2023-03-28 11:48:35 +07:00
|
|
|
VOLUME /storage
|
2019-03-11 14:35:19 +07:00
|
|
|
|
2023-03-28 11:48:35 +07:00
|
|
|
EXPOSE 22
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 139
|
|
|
|
EXPOSE 443
|
|
|
|
EXPOSE 445
|
2023-03-27 01:29:21 +07:00
|
|
|
EXPOSE 5000
|
|
|
|
EXPOSE 5001
|
|
|
|
|
2023-04-14 06:03:38 +07:00
|
|
|
ENV URL ""
|
2023-04-05 03:21:58 +07:00
|
|
|
ENV CPU_CORES 1
|
2023-04-11 11:06:40 +07:00
|
|
|
ENV DISK_SIZE 16G
|
|
|
|
ENV RAM_SIZE 512M
|
2023-03-28 03:25:47 +07:00
|
|
|
|
2023-04-16 23:03:11 +07:00
|
|
|
HEALTHCHECK --interval=30s --timeout=2s CMD curl -f http://20.20.20.21:5000/robots.txt || exit 1
|
2023-04-16 22:27:50 +07:00
|
|
|
|
2019-03-11 14:35:19 +07:00
|
|
|
ENTRYPOINT ["/run/run.sh"]
|