Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
docker-compose-with-volume [docker in a nutshell]
version: "3.7"
services:
spring-app:
build: .
image: spring-app
ports:
- "4000:8080"
networks:
- shared-network
depends_on:
- redis-service
redis-service:
image: redis
volumes:
- data:/data # attach a volume (hostDirectory:containerDirectory)
networks:
- shared-network
networks:
shared-network: {}
volumes:
data: {} # define volume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment