im new in docker and docker-compos. this is my Docker and its created successfully.
FROM python:3.8-buster
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
COPY . .
ARG name
RUN apt-get update
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
docker-compose.yml :
version: "3.7"
services:
django_web:
build: .
command: >
apt -c "python3 manage.py makemigrations && python3 manage.py migrate && gunicorn mlAmeri.wsgi:application --bind 0.0.0.0:8000"
volumes:
- static: /app/staitc
- media: /app/media
- .: /app
ports:
- 8010:8000
nginx:
build: ./nginx
volumes:
- static:/app/static
- media:/app/media
- ./nginx/config/:/etc/nginx/conf.d/
ports:
- 8000:80
depends_on:
- django_web
volumes:
# postgres_data:
static:
media:
and this my error
services.django_web.volumes 'type' is a required property
what's meaning of type ? what i miss?
You are just missing some quotes I believe:
volumes:
- "static:/app/staitc"
- "media:/app/media"
- ".:/app"
See the documentation: https://github.com/docker/compose/blob/v1/docs/Compose%20file%20reference%20(legacy)/version-3.md
Edit: note that it's not a good practice to mount the entire current folder into the container though. You will be leaking unnecessary stuff in the container.