diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..f59510d --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,24 @@ +FROM python:3.11-slim + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +ENV PYTHONPATH=/app + +WORKDIR /app + +RUN apt-get update && apt-get install -y build-essential gcc --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* + +COPY requirements.txt /app/requirements.txt +RUN pip install --upgrade pip \ + && pip install --no-cache-dir -r /app/requirements.txt + +# Copy as /app/app to preserve package +COPY app/ /app/app/ + +RUN useradd -m appuser && chown -R appuser:appuser /app +USER appuser + +EXPOSE 8000 + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fd62b92 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.9" + +services: + frontend: + build: + context: ./frontend + dockerfile: Dockerfile + container_name: fusionpact-frontend + ports: + - "8080:80" + restart: unless-stopped + + backend: + build: + context: ./backend + dockerfile: Dockerfile + container_name: fusionpact-backend + ports: + - "8000:8000" + restart: unless-stopped diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..208ab8a --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,11 @@ +FROM nginx:alpine + +WORKDIR /usr/share/nginx/html + +RUN rm -rf ./* + +COPY Devops_Intern.html /usr/share/nginx/html/index.html + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"]