mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 00:57:44 +01:00
Merge pull request #4514 from yixingjia/usemonitorapi
Use new health check api for docker files
This commit is contained in:
commit
ba4c7f5731
@ -7,7 +7,7 @@ RUN tdnf erase vim -y \
|
||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \
|
||||
&& mkdir /harbor/
|
||||
COPY ./make/dev/adminserver/harbor_adminserver ./make/photon/adminserver/start.sh /harbor/
|
||||
HEALTHCHECK CMD curl -s -o /dev/null -w "%{http_code}" 127.0.0.1:8080/api/configurations|grep 401
|
||||
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:8080/api/ping || exit 1
|
||||
|
||||
RUN chmod u+x /harbor/harbor_adminserver /harbor/start.sh
|
||||
WORKDIR /harbor/
|
||||
|
@ -10,4 +10,6 @@ EXPOSE 80
|
||||
VOLUME /var/cache/nginx /var/log/nginx /run
|
||||
STOPSIGNAL SIGQUIT
|
||||
|
||||
HEALTHCHECK CMD curl --fail -s http://127.0.0.1 || exit 1
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
@ -21,8 +21,10 @@ RUN touch /etc/localtime.bak \
|
||||
VOLUME /var/lib/postgresql/data
|
||||
|
||||
ADD docker-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod u+x /entrypoint.sh
|
||||
ADD docker-healthcheck.sh /docker-healthcheck.sh
|
||||
RUN chmod u+x /entrypoint.sh /docker-healthcheck.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
HEALTHCHECK CMD ["/docker-healthcheck.sh"]
|
||||
|
||||
EXPOSE 5432
|
||||
CMD ["postgres"]
|
||||
|
8
make/photon/postgresql/docker-healthcheck.sh
Normal file
8
make/photon/postgresql/docker-healthcheck.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
psql -h "localhost" -U "postgres" -c 'select 1'
|
||||
ret_code=$?
|
||||
|
||||
if [ $ret_code != 0 ]; then
|
||||
exit 1
|
||||
fi
|
@ -7,7 +7,7 @@ RUN tdnf distro-sync -y \
|
||||
&& groupadd -r -g 10000 harbor && useradd --no-log-init -r -g 10000 -u 10000 harbor \
|
||||
&& mkdir /harbor/
|
||||
|
||||
HEALTHCHECK CMD curl -s -o /dev/null -w "%{http_code}" 127.0.0.1:8080/api/systeminfo|grep 200
|
||||
HEALTHCHECK CMD curl --fail -s http://127.0.0.1:8080/api/ping || exit 1
|
||||
COPY ./make/dev/ui/harbor_ui ./src/favicon.ico ./make/photon/ui/start.sh ./UIVERSION /harbor/
|
||||
COPY ./src/ui/views /harbor/views
|
||||
COPY ./src/ui/static /harbor/static
|
||||
|
Loading…
Reference in New Issue
Block a user