-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jialong.wang
committed
Apr 23, 2024
1 parent
d3a49f0
commit 1fb5e82
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM --platform=linux/arm64 golang:1.21 as build | ||
COPY . /app/amprobe | ||
ENV GO111MODULE="on" \ | ||
GOPROXY=https://goproxy.cn,direct | ||
|
||
RUN cd /app/amprobe && \ | ||
GOOS=linux GOARCH=arm64 go build -a -tags netgo -o /app/amprobe/amprobe ./cmd/amprobe | ||
|
||
FROM --platform=linux/arm64 ubuntu:22.04 | ||
WORKDIR /app | ||
|
||
COPY --from=build /app/amprobe/amprobe /app/ | ||
|
||
RUN apt update && \ | ||
apt install -y nginx && \ | ||
apt install -y supervisor && \ | ||
useradd -M -s /sbin/nologin nginx && \ | ||
touch /app/probe.db && \ | ||
chmod +x /app/amprobe | ||
|
||
COPY ./configs /app/configs | ||
COPY ./web/dist /usr/share/nginx/html | ||
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY ./supervisor /etc/supervisor/conf.d | ||
|
||
# 这里有点坑,不加 -n 服务启动不了 | ||
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"] |