Created
June 17, 2022 05:31
-
-
Save hakaneroztekin/983a868d3cb8340a5e0cd98b3e984f9e to your computer and use it in GitHub Desktop.
docker-compose-with-volume [docker in a nutshell]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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