Skip to content

Instantly share code, notes, and snippets.

@hakaneroztekin
Created June 17, 2022 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakaneroztekin/983a868d3cb8340a5e0cd98b3e984f9e to your computer and use it in GitHub Desktop.
Save hakaneroztekin/983a868d3cb8340a5e0cd98b3e984f9e to your computer and use it in GitHub Desktop.
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