I'm using python
3.8, Docker
version 19.03.13, build 4484c46d9d 3.8
version: '3.8'
services:
web:
build: .
command: python /code/manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- 8000:8000
Thanks in advance. You re right, Dockerfile is not necessary. Docker Compose uses YAML file, typically named docker-compose. yml to define what your mutliple-container application should look like.
Validating your file now is as simple as docker-compose -f docker-compose. yml config . As always, you can omit the -f docker-compose. yml part when running this in the same folder as the file itself or having the COMPOSE_FILE environment variable pointing to your file.
The docker-compose. override. yml is the configuration file where you can override existing settings from docker-compose. yml or even add completely new services. By default, this file does not exist and you must create it.
A docker-compose. yml is a config file for Docker Compose. It allows to deploy, combine, and configure multiple docker containers at the same time. The Docker "rule" is to outsource every single process to its own Docker container.
Maybe docker-compose.yml is empty
Your .yml file must be empty. Try saving the file.
If you have just created your docker-compose.yml
chances are you haven't saved it and hit docker-compose up
.
Save it and try again. It should work fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With