Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

프로젝트 root 분리 #25

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run: docker compose build

- name: Migration test database
run: docker compose run django poetry run python manage.py migrate
run: docker compose run django poetry run python src/manage.py migrate

- name: Run isort
run: docker compose run django poetry run isort . --check
Expand All @@ -26,4 +26,4 @@ jobs:
run: docker compose run django poetry run flake8

- name: Run Test
run: docker compose run django poetry run python3 manage.py test
run: docker compose run django poetry run python3 src/manage.py test
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ RUN python3 -m venv $POETRY_VENV \
ENV PATH="${PATH}:${POETRY_VENV}/bin"

RUN mkdir /app/
WORKDIR /app/
RUN mkdir /app/src/
WORKDIR /app

COPY pyproject.toml ./
COPY pyproject.toml /app/
COPY setup.cfg /app/

RUN poetry install

COPY . /app
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ services:
build:
context: .
dockerfile: Dockerfile
command: poetry run python manage.py runserver 0.0.0.0:8000
command: >
bash -c "poetry run python src/manage.py makemigrations &&
poetry run python src/manage.py migrate &&
poetry run python src/manage.py runserver 0.0.0.0:8000"
volumes:
- .:/app
- ./src:/app/src/
environment:
- POSTGRESQL_HOST=postgres
ports:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion config/settings.py → src/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from pathlib import Path

import environ
import os

BASE_DIR = Path(__file__).resolve().parent.parent

Expand Down
10 changes: 4 additions & 6 deletions config/urls.py → src/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from rest_framework import permissions

from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static

from drf_yasg.views import get_schema_view
from django.contrib import admin
from django.urls import include, path
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
from rest_framework import permissions

schema_view = get_schema_view(
openapi.Info(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.