Advertisement
thesuhu

Docker Service

Sep 28th, 2020 (edited)
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. # create service dari gitlab private repo
  2. docker login registry.gitlab.com
  3.  
  4. docker service create \
  5.   --with-registry-auth \
  6.   --name nama_svc \
  7.   --publish 81:3002 \
  8.   --replicas=1 \
  9.   --mount type=bind,source=/var/log/applog,destination=/logs \
  10.   registry.gitlab.com/.../.../.../nama_image:latest
  11.  
  12. # setelah itu tambahkan secret via portainer, overwrite .env dengan secret
  13. # create secret, copas isi .env ke secret
  14. # di service, add secret, pilih secret -> overide ke direktori root app (contoh: /usr/src/myapp/.env)
  15.  
  16. # change image
  17. docker service update --image <new_image> <service_name>
  18. docker service update --image nginx:latest my_web_service
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement