diff --git a/backend-app/Dockerfile.prod b/backend-app/Dockerfile.prod new file mode 100644 index 00000000..679ba9a2 --- /dev/null +++ b/backend-app/Dockerfile.prod @@ -0,0 +1,21 @@ +FROM python:3.12-slim + +# Update and install dependencies +RUN apt-get update \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR / + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +COPY /app/ /app/ + +ENV FASTAPI_HASH_ALGORITHM=HS256 +ENV ACCESS_TOKEN_EXPIRE_MINUTES=30 +ENV USER_DB_URL=sqlite:///./sql_app.db +ENV FILE_DB_URL=sqlite:///./file_sql.db + +EXPOSE 8000 + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 2dde7cb9..7e889ca6 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -2,7 +2,7 @@ services: frontend: build: context: ./frontend-app/ - dockerfile: Dockerfile + dockerfile: Dockerfile.prod environment: - NEXT_PUBLIC_ENVIRONMENT - NEXT_PUBLIC_API_URL @@ -16,7 +16,7 @@ services: backend: build: context: ./backend-app/ - dockerfile: Dockerfile + dockerfile: Dockerfile.prod environment: - FASTAPI_SECRET_KEY - FASTAPI_HASH_ALGORITHM diff --git a/frontend-app/Dockerfile.prod b/frontend-app/Dockerfile.prod new file mode 100644 index 00000000..aadcfa37 --- /dev/null +++ b/frontend-app/Dockerfile.prod @@ -0,0 +1,13 @@ +FROM node:slim + +WORKDIR /app + +COPY package.json ./ + +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "run", "dev"]