Persistence Docker Volume Configuration #551
Sen-Gupta
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Everyone,
In order to ensure the docker container reuses the settings/configuration after re-deploy after CI/CD. Please ensure your volume look like as shown below
version: '3.9'
services:
grandnode:
image: ${DOCKER_REGISTRY-}grandnode/grandnode2:latest
build:
context: ..
dockerfile: Dockerfile
container_name: grandnode
restart: unless-stopped
environment:
- ASPNETCORE_ENVIRONMENT=${ENVIRONMENT}
- ASPNETCORE_URLS=http://0.0.0.0:80
ports:
- "9980:80"
volumes:
- /etc/ssl/certs:/https:ro
- grandnode_data:/app/App_Data
- grandnode_wwwroot:/app/wwwroot
networks:
- grandnode
networks:
grandnode:
external: true
volumes:
grandnode_data:
grandnode_wwwroot:
Also please observe that we are only running it on port 80 as we have it being proxied through cloudflare and there is no need to run https:
The key is to notice the volume configurations.
The following docker compose shall also run perfectly with docker compose, and shall survice restarts, container deletion etc.
I have removed MongoDB as we are using a manged service for it being hosted elsewhere. but you can add it as desired.
Beta Was this translation helpful? Give feedback.
All reactions