Implement #11 mhu/11-add-docker-compose-setup: Add compose setup #12
@ -1,5 +1,5 @@
|
|||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk add --no-cache python3 py3-pip python3-dev py3-setuptools gcc python3-dev jpeg-dev zlib-dev musl-dev py3-gunicorn
|
RUN apk add --no-cache python3 py3-pip python3-dev py3-setuptools gcc python3-dev jpeg-dev zlib-dev musl-dev py3-gunicorn curl
|
||||||
COPY . /home/shimatta/kenkyusho
|
COPY . /home/shimatta/kenkyusho
|
||||||
WORKDIR /home/shimatta/kenkyusho
|
WORKDIR /home/shimatta/kenkyusho
|
||||||
RUN python3 -m venv /home/shimatta/kenkyusho/.venv && . /home/shimatta/kenkyusho/.venv/bin/activate && pip install -r requirements.txt
|
RUN python3 -m venv /home/shimatta/kenkyusho/.venv && . /home/shimatta/kenkyusho/.venv/bin/activate && pip install -r requirements.txt
|
||||||
|
@ -22,6 +22,12 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
shimatta-kenkyusho-db:
|
shimatta-kenkyusho-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -f localhost:8000/healthcheck"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
shimatta-kenkyusho-db:
|
shimatta-kenkyusho-db:
|
||||||
image: postgres:16.5-alpine
|
image: postgres:16.5-alpine
|
||||||
|
@ -16,4 +16,5 @@ urlpatterns = [
|
|||||||
path('distributors/<slug:uuid>/', parts_views.DistributorDetailView.as_view(), name='parts-distributors-detail'),
|
path('distributors/<slug:uuid>/', parts_views.DistributorDetailView.as_view(), name='parts-distributors-detail'),
|
||||||
path('manufacturers/', parts_views.ManufacturersViewSet.as_view(), name='parts-manufacturers'),
|
path('manufacturers/', parts_views.ManufacturersViewSet.as_view(), name='parts-manufacturers'),
|
||||||
path("manufacturers/<slug:uuid>/", parts_views.ManufacturerDetailViewSet.as_view(), name='parts-manufacturers-detail'),
|
path("manufacturers/<slug:uuid>/", parts_views.ManufacturerDetailViewSet.as_view(), name='parts-manufacturers-detail'),
|
||||||
|
path("healthcheck/", parts_views.health_check_view, name='parts-health-check'),
|
||||||
]
|
]
|
||||||
|
@ -18,8 +18,10 @@ from .forms import *
|
|||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.db.models.functions import Lower
|
from django.db.models.functions import Lower
|
||||||
from django.forms import formset_factory
|
from django.forms import formset_factory
|
||||||
|
from django.http import HttpResponse
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
ParameterSearchFormSet = formset_factory(ComponentParameterSearchForm, extra=1)
|
ParameterSearchFormSet = formset_factory(ComponentParameterSearchForm, extra=1)
|
||||||
|
|
||||||
class QrSearchForm(forms.Form):
|
class QrSearchForm(forms.Form):
|
||||||
@ -953,4 +955,12 @@ class ManufacturerDetailViewSet(LoginRequiredMixin, BaseTemplateMixin, DetailVie
|
|||||||
elif 'submit-manufacturer-edit' in request.POST:
|
elif 'submit-manufacturer-edit' in request.POST:
|
||||||
return self.edit_manufacturer(request)
|
return self.edit_manufacturer(request)
|
||||||
|
|
||||||
return super().post(request, *args, **kwargs)
|
return super().post(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
def health_check_view(request) -> HttpResponse:
|
||||||
|
"""
|
||||||
|
Health checking view. Returns empty http response with HTTP status OK.
|
||||||
|
This will be used to check
|
||||||
|
"""
|
||||||
|
return HttpResponse(status=200)
|
Loading…
Reference in New Issue
Block a user