Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support manager-api systemd startup script #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ package-dashboard-rpm:
--iteration $(iteration) \
--description 'Apache APISIX Dashboard is designed to make it as easy as possible for users to operate Apache APISIX through a frontend interface.' \
--license "ASL 2.0" \
--after-install ${PWD}/deps/after-install.sh \
-C ${PWD}/build/rpm/output/apisix/dashboard/ \
-p ${PWD}/output/ \
--url 'https://github.com/apache/apisix-dashboard'
Expand Down
3 changes: 3 additions & 0 deletions deps/after-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
systemctl daemon-reload \
&& systemctl enable apisix-dashboard.service \
&& chown -R nobody: /usr/local/apisix/dashboard/logs
13 changes: 13 additions & 0 deletions deps/apisix-dashboard.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=APACHE APISIX Dashboard Service
After=network.target

[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/bin/manager-api -p /usr/local/apisix/dashboard

[Install]
WantedBy=multi-user.target
7 changes: 5 additions & 2 deletions dockerfiles/Dockerfile.dashboard.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ARG dashboard_repo="https://github.com/apache/apisix-dashboard.git"

FROM ${image_base}:${image_tag}

COPY ./deps/apisix-dashboard.service /tmp/build/output/apisix/dashboard/usr/lib/systemd/system/apisix-dashboard.service

RUN set -x \
# install dependency
&& yum install -y wget curl git which gcc make \
Expand All @@ -20,8 +22,9 @@ ARG checkout_v
ARG iteration
ARG dashboard_repo
RUN set -x \
&& mkdir -p /tmp/build/output/apisix/dashboard/usr/bin/ \
&& mkdir -p /tmp/build/output/apisix/dashboard/usr/local/apisix/dashboard/ \
&& mkdir -pv /tmp/build/output/apisix/dashboard/usr/bin/ \
&& mkdir -pv /tmp/build/output/apisix/dashboard/usr/local/apisix/dashboard/ \
&& mkdir -pv /tmp/build/output/apisix/dashboard/usr/lib/systemd/system \
# config golang
&& export GO111MODULE=on \
&& export GOROOT=/usr/local/go \
Expand Down