First commit with next js.

This commit is contained in:
charles-gauthereau
2024-11-03 11:26:37 +01:00
parent 54248b8670
commit c3dbdd8833
118 changed files with 97 additions and 8756 deletions
-21
View File
@@ -1,21 +0,0 @@
FROM python:3.12-bookworm
ENV PYTHONUNBUFFERED 1
COPY requirements/requirements.txt /tmp/requirements.txt
COPY requirements/requirements.dev.txt /tmp/requirements.dev.txt
WORKDIR /src
ARG DEV=false
RUN apt-get install openssh-client -y
RUN apt-get update
RUN apt-get install -y postgresql postgresql-client binutils libproj-dev gdal-bin
RUN pip install -r /tmp/requirements.txt
RUN pip install -r /tmp/requirements.dev.txt
COPY . /src
ENV PATH="/scripts:/py/bin:$PATH"
CMD ["gunicorn", "main:app", "--bind", "0.0.0.0:80","--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker"]
-12
View File
@@ -1,12 +0,0 @@
FROM node:lts-alpine3.19
ENV NODE_OPTIONS="--max-old-space-size=8192"
WORKDIR /app
COPY package.json .
RUN npm install -f
CMD ["npm", "run", "dev"]
-29
View File
@@ -1,29 +0,0 @@
# Stage 1: Build the frontend
FROM node:18 AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ ./
RUN npm run build
# Stage 2: Build the backend
FROM python:3.11-slim AS backend-build
WORKDIR /app/backend
COPY backend/requirements/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/ ./
RUN apt-get -y update
RUN apt-get -y install curl
# Copy the built frontend to the backend's static directory
COPY --from=frontend-build /app/frontend/dist /app/backend/static
# Expose the backend port (e.g., 80 for FastAPI)
EXPOSE 80
# Set the environment to production
ENV ENV=production
# Set the command to run the backend server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
#CMD ["gunicorn", "main:app", "--bind", "0.0.0.0:80","--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker"]