From 6273aaa856fcd6df4f3af39310e1f29fdb83b2ac Mon Sep 17 00:00:00 2001 From: Penny Date: Sun, 27 Oct 2024 09:30:42 +0900 Subject: [PATCH] config flake8 --- Dockerfile | 5 +++++ app/.flake8 | 6 ++++++ docker-compose.yml | 2 ++ requirements.dev.txt | 1 + 4 files changed, 14 insertions(+) create mode 100644 app/.flake8 create mode 100644 requirements.dev.txt diff --git a/Dockerfile b/Dockerfile index 275b7ac..d0d5774 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,13 +4,18 @@ LABEL maintainer="pfb" ENV PYTHONUNBUFFERED=1 COPY ./requirements.txt /tmp/requirements.txt +COPY ./requirements.dev.txt /tmp/requirements.dev.txt COPY ./app /app WORKDIR /app EXPOSE 8000 +ARG DEV=false RUN python -m venv /py && \ /py/bin/pip install --upgrade pip && \ /py/bin/pip install -r /tmp/requirements.txt && \ + if [ $DEV = "true" ]; \ + then /py/bin/pip install -r /tmp/requirements.dev.txt; \ + fi && \ rm -rf /tmp && \ adduser \ --disabled-password \ diff --git a/app/.flake8 b/app/.flake8 new file mode 100644 index 0000000..19cf0d8 --- /dev/null +++ b/app/.flake8 @@ -0,0 +1,6 @@ +[flake8] +exclude = + migrations, + __pycache__, + manage.py, + settings.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 7e5ac59..c79e31f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ services: app: build: context: . + args: + - DEV=true ports: - "8000:8000" volumes: diff --git a/requirements.dev.txt b/requirements.dev.txt new file mode 100644 index 0000000..27d00bc --- /dev/null +++ b/requirements.dev.txt @@ -0,0 +1 @@ +flake8>=3.9.2,<3.10 \ No newline at end of file