diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index f035fae..c03255f 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -41,7 +41,6 @@ COPY ./pyproject.toml ./poetry.lock /app/ RUN poetry install --no-root --only main RUN preview --check-dependencies - COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint @@ -54,6 +53,10 @@ COPY ./compose/local/django/spacy_setup /spacy_setup RUN sed -i 's/\r$//g' /spacy_setup RUN chmod +x /spacy_setup +COPY ./compose/local/django/start-redirect /start-redirect +RUN sed -i 's/\r$//g' /start-redirect +RUN chmod +x /start-redirect + COPY ./compose/local/django/install_preview_dependencies /install_preview_dependencies RUN sed -i 's/\r$//g' /install_preview_dependencies RUN chmod +x /install_preview_dependencies diff --git a/compose/local/django/start_redirect b/compose/local/django/start-redirect similarity index 69% rename from compose/local/django/start_redirect rename to compose/local/django/start-redirect index e15d7c6..8cb41cc 100644 --- a/compose/local/django/start_redirect +++ b/compose/local/django/start-redirect @@ -7,4 +7,4 @@ set -o nounset python manage.py migrate auth python manage.py migrate -uvicorn redirect.app:app --port 3000 +uvicorn redirect.app:app --port 3000 --host 0.0.0.0 diff --git a/compose/production/django/Dockerfile b/compose/production/django/Dockerfile index c138482..6ef8c04 100644 --- a/compose/production/django/Dockerfile +++ b/compose/production/django/Dockerfile @@ -64,6 +64,9 @@ COPY --chown=django:django ./compose/production/django/celery/worker/start /star RUN sed -i 's/\r$//g' /start-celeryworker RUN chmod +x /start-celeryworker +COPY ./compose/local/django/start-redirect /start-redirect +RUN sed -i 's/\r$//g' /start-redirect +RUN chmod +x /start-redirect COPY --chown=django:django ./compose/production/django/celery/beat/start /start-celerybeat RUN sed -i 's/\r$//g' /start-celerybeat diff --git a/local.yml b/local.yml index f5ad62e..605b39d 100644 --- a/local.yml +++ b/local.yml @@ -43,7 +43,7 @@ services: - ./.envs/.local/.postgres ports: - "3000:3000" - command: /start_redirect + command: /start-redirect postgres: build: diff --git a/production.yml b/production.yml index fa2da68..ab637b3 100644 --- a/production.yml +++ b/production.yml @@ -24,6 +24,28 @@ services: - ./.envs/.production/.postgres command: /start + + redirect: + build: + context: . + dockerfile: ./compose/production/django/Dockerfile + image: akarpov_production_redirect + container_name: akarpov_production_redirect + platform: linux/x86_64 + depends_on: + - postgres + - redis + - mailhog + volumes: + - .:/app:z + env_file: + - ./.envs/.production/.django + - ./.envs/.production/.postgres + ports: + - "3000:3000" + command: /start-redirect + + postgres: build: context: .