This commit is contained in:
Darren 2023-10-18 17:21:53 +08:00 committed by GitHub
parent 12bf505f20
commit 9a1faac8b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 1 deletions

View file

@ -7,4 +7,5 @@
- use virtualenv for pip install requirements.txt
- create volumes at dockerfile
- EXPOSE port
- process logs should output to docker logs by supervisord
- process logs should output to docker logs by supervisord
- [uvicorn](https://www.uvicorn.org/) load Fastapi

View file

@ -7,11 +7,16 @@ COPY init_portainer.go /
RUN go build -o init_portainer /init_portainer.go
RUN chmod +x /init_portainer
#COPY environment.go /
#RUN go build -o environment /environment.go
#RUN chmod +x /environment
# step2: Copy build go program to portainer
# Dockerfile refer to: https://github.com/portainer/portainer/blob/develop/build/linux/Dockerfile
FROM portainer/portainer-ce:2.19.0
LABEL maintainer="websoft9<help@websoft9.com>"
LABEL version="2.19.0"
COPY --from=builder /init_portainer /
#COPY --from=builder /environment /
ENTRYPOINT ["/init_portainer"]

View file

@ -0,0 +1,30 @@
#### go code below
package main
#1 wait and get credential
#2 portainer api login
#3 add local if not exist
```
name: local
url: /var/run/docker.sock
```
curl -X POST -H "Content-Type: application/json" -d '{"username":"admin", "Password":"'$new_password'"}' http://$portainer_ip:9000/api/users/admin/init
curl "http://$appmanage_ip:5000/AppUpdateUser?user_name=admin&password=$new_password"
#### other place
- add it to Dockerfile
- docker compose health check
```
healthcheck:
test: ["CMD", "/healthcheck"]
interval: 1m30s
timeout: 10s
retries: 3
```