chore [P-01]: Докер
This commit is contained in:
1 parent
29cf9b2a14
commit
bc6668c54c
225 files changed
+398
-1409
No files matched your search
@@ -1,5 +1,5 @@
|
||||
FROM python:3.10.13-slim
|
||||
RUN mkdir /back
|
||||
|
||||
WORKDIR /back
|
||||
|
||||
ARG SOURCE_DIR
|
||||
@@ -17,24 +17,25 @@ RUN apt-get update && apt-get install -y \
|
||||
COPY ${SOURCE_DIR}/r.txt .
|
||||
|
||||
# Устанавливаем зависимости
|
||||
RUN python -m venv env
|
||||
RUN ./env/bin/pip install --no-cache-dir -r r.txt
|
||||
# RUN python -m venv env
|
||||
RUN pip install --no-cache-dir -r r.txt
|
||||
|
||||
|
||||
# Копируем все файлы проекта в контейнер
|
||||
COPY ${SOURCE_DIR} .
|
||||
COPY sys/wait-for-it.sh /usr/local/bin/wait-for-it
|
||||
RUN dos2unix /usr/local/bin/wait-for-it
|
||||
# COPY sys/wait-for-it.sh /usr/local/bin/wait-for-it
|
||||
# RUN dos2unix /usr/local/bin/wait-for-it
|
||||
# Выполняем миграции (при необходимости)
|
||||
# RUN python manage.py makemigrations
|
||||
# RUN python manage.py migrate
|
||||
RUN chmod +x /usr/local/bin/wait-for-it
|
||||
# RUN chmod +x /usr/local/bin/wait-for-it
|
||||
# Открываем порт, на котором будет работать приложение
|
||||
EXPOSE 8000
|
||||
|
||||
COPY docker/entries/backend-entrypoint.sh /script/backend-entrypoint.sh
|
||||
RUN dos2unix /script/backend-entrypoint.sh && chmod 777 /script/backend-entrypoint.sh
|
||||
# Команда для запуска приложения
|
||||
# "wait-for-it", "db:3306", "--",
|
||||
# CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
CMD ["sh", "-c", "wait-for-it db:3306 -- ./env/bin/python manage.py runserver 0.0.0.0:8000"]
|
||||
# CMD ["sh", "-c", "wait-for-it db:3306 -- ./env/bin/python manage.py runserver 0.0.0.0:8000"]
|
||||
# CMD ["tail", "-f", "/dev/null"]
|
||||
# CMD ["sh", "-c","wait-for-it db:3306", "--", "python", "manage.py", "runserver", "0.0.0.0:8000"]
|
||||
Reference in new issue
Block a user