mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
fix
This commit is contained in:
parent
12bf505f20
commit
9a1faac8b0
3 changed files with 37 additions and 1 deletions
|
@ -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
|
|
@ -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"]
|
30
docker/deployment/environment.go
Normal file
30
docker/deployment/environment.go
Normal 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
|
||||
```
|
Loading…
Reference in a new issue