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
-8
View File
@@ -1,8 +0,0 @@
services:
backup_agent:
container_name: backup_agent
build:
context: ../../
dockerfile: docker/dockerfile/prod/Dockerfile
ports:
- 8888:80
-5
View File
@@ -1,5 +0,0 @@
services:
backup_agent:
image: rambok/backup-agent:rc1
ports:
- 8885:80
-49
View File
@@ -1,49 +0,0 @@
services:
backend:
build:
context: ../../backend
dockerfile: ../docker/dockerfile/dev/backend/Dockerfile
volumes:
- ../../backend:/src
command: uvicorn main:app --reload --host 0.0.0.0 --port 80
depends_on:
db:
condition: service_healthy
ports:
- 8888:80
frontend:
build:
context: ../../frontend
dockerfile: ../docker/dockerfile/dev/frontend/Dockerfile
ports:
- 8887:80
volumes:
- ../../frontend:/app
- /app/node_modules
db:
image: postgres:15
ports:
- "5432:5432"
environment:
- POSTGRES_DB=devdb
- POSTGRES_USER=devuser
- POSTGRES_PASSWORD=changeme
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U devuser -d devdb -h db" ]
interval: 2s
timeout: 2s
retries: 20
volumes:
- portabase-db:/var/lib/postgresql/data
volumes:
portabase-db:
-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"]