我想用docker和uwsgi在windows11上部署我的django项目,但是得到了一些错误。
docker build . -t djangohw
docker run -it --rm djangohw -p 8080:80
docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "-p": executable file not found in $PATH: unknown.
停靠文件
FROM python:3.9
ENV DEPLOY=1
WORKDIR /opt/tmp
COPY . .
RUN pip install -r requirements.txt
EXPOSE 80
CMD ["sh", "start.sh"]
开始.sh
python3 manage.py makemigrations board
python3 manage.py migrate
uwsgi --module=mysite.wsgi:application \
--env DJANGO_SETTINGS_MODULE=mysite.settings \
--master \
--http=0.0.0.0:0 \
--processes=5 \
--harakiri=20 \
--max-requests=5000 \
--vacuum
要求.txt
django==4.1.3
django-cors-headers
pytest
pytest-django
coverage
uwsgi
1条答案
按热度按时间vfh0ocws1#
-p [hostPort]:{containerPort}
应该放在映像名称前面,否则它将被视为容器启动时要运行的命令docker run -it --rm -p 8080:80 djangohw
应该正确。