Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Oct 18, 2023
1 parent 12bf505 commit 9a1faac
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/apphub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions docker/deployment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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<[email protected]>"
LABEL version="2.19.0"
COPY --from=builder /init_portainer /
#COPY --from=builder /environment /

ENTRYPOINT ["/init_portainer"]
30 changes: 30 additions & 0 deletions docker/deployment/environment.go
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 9a1faac

Please sign in to comment.