First commit

This commit is contained in:
charles-gauthereau
2024-10-19 15:55:51 +02:00
commit 1069b2c3ad
99 changed files with 9718 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
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 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
@@ -0,0 +1,12 @@
FROM node:lts-alpine3.19
ENV NODE_OPTIONS="--max-old-space-size=8192"
WORKDIR /app
COPY package.json .
RUN yarn install -f
CMD ["yarn", "run", "dev"]
+29
View File
@@ -0,0 +1,29 @@
# 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"]