Answer the question
In order to leave comments, you need to log in
How to create an anonymous volume in docker by giving it a path?
Can't deal with volumes in docker. I want to create two anonymous volumes when starting containers in order to pass the code from the local machine to the containers. One volume for one container, another for another.
I have this docker-compose.yml file:
version: "3"
services:
client:
build: client/
command: npm run dev
env_file:
- ".env"
ports:
- "${CLIENT_PORT}:${CLIENT_PORT}"
api:
build: api/
command: npm run dev
env_file:
- ".env"
ports:
- "${API_PORT}:${API_PORT}"
Answer the question
In order to leave comments, you need to log in
version: "3"
services:
client:
build: client/
command: npm run dev
env_file:
- ".env"
ports:
- "${CLIENT_PORT}:${CLIENT_PORT}"
volumes:
- ./client:/client
api:
build: api/
command: npm run dev
env_file:
- ".env"
ports:
- "${API_PORT}:${API_PORT}"
volumes:
- ./api:/api
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question