Skip to content

Instantly share code, notes, and snippets.

@hakaneroztekin
Created June 17, 2022 05:31
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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