Skip to content

Commit

Permalink
feat: add Dockerfile.arm
Browse files Browse the repository at this point in the history
  • Loading branch information
jialong.wang committed Apr 23, 2024
1 parent d3a49f0 commit 1fb5e82
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Dockerfile.arm
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"]

0 comments on commit 1fb5e82

Please sign in to comment.