I am new in docker. I want to run my django app on port 9000. After command docker-compose up I am getting this message
Creating motion_full_version_backend_1 ... done
Attaching to motion_full_version_backend_1
backend_1 | Unknown command: 'makemigrations
'. Did you mean makemigrations?
backend_1 | Type 'manage.py help' for usage.
backend_1 | Unknown command: 'migrate
'. Did you mean migrate?
backend_1 | Type 'manage.py help' for usage.
" is not a valid port number or address:port pair.*
My Dockerfile :
FROM continuumio/miniconda3:latest
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update && apt-get upgrade -y && apt-get install -qqy
wget
bzip2
graphviz
RUN mkdir -p /backend
COPY ./backend/requirements.yml /backend/requirements.yml
# Create environment
RUN /opt/conda/bin/conda env create -f /backend/requirements.yml
# Add env path to environment
ENV PATH /opt/conda/envs/backend/bin:$PATH
# Activate interpreter
RUN echo "source activate backend" >~/.bashrc
# Create a scripts folder
RUN mkdir -p /scripts
COPY ./scripts /scripts
RUN chmod +x ./scripts*
COPY ./backend /backend
WORKDIR /backend
I am using script to run it
python manage.py makemigrations
python manage.py migrate
python manage.py runserver 0.0.0.0:9000
my docker-compose.yml looks like this
version: '3'
services:
backend:
image: backend:latest
restart: always
env_file:
- ./envs/dev.env
command: 'sh /scripts/dev.sh'
ports:
- "9000:9000"
Any Ideas what I am doing wrong?
question from:
https://stackoverflow.com/questions/65644913/docker-is-not-a-valid-port-number-or-addressport-pair 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…