作者:zealyw | 来源:互联网 | 2023-08-10 12:38
我有dockerfile和docker-compose。当我写docker-compose up时出现错误。我的应用程序目录为/ www / django-folder / crinfo /.
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y apt-utils vim curl apache2 apache2-utils
RUN apt-get -y install python3 libapache2-mod-wsgi-py3
RUN ln /usr/bin/python3 /usr/bin/python
RUN apt-get -y install python-dev default-libmysqlclient-dev
RUN apt-get -y install python3-pip
RUN ln /usr/bin/pip3 /usr/bin/pip
RUN pip install --upgrade pip
COPY . /var/www/api/
WORKDIR /var/www/api/
RUN pip install -r requirements.txt
RUN pip install ptvsd
ADD ./site-conf.conf /etc/apache2/sites-available/000-default.conf
EXPOSE 80 3500
CMD ["apache2ctl","-D","FOREGROUND"]
我的docker-compose是
version: "2"
services:
django-apache2:
build: .
container_name: django-apache2
ports:
- "8005:80"
- "3500:3500"
- "8006:81"
volumes:
- $PWD/www:/var/www/html
command: >
- /bin/sh/ -c "python ./www/django-folder/crinfo/manage.py makemigrations && ./www/django-folder/crinfo/manage.py migrate "
我想在编写docker compose时进行迁移和进行迁移