Skip to content

Commit

Permalink
Add Dockerfile.prod + change in compose
Browse files Browse the repository at this point in the history
  • Loading branch information
BraunRudolf committed Jul 27, 2024
1 parent c8162c3 commit 326a1e3
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
21 changes: 21 additions & 0 deletions backend-app/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -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"]
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
frontend:
build:
context: ./frontend-app/
dockerfile: Dockerfile
dockerfile: Dockerfile.prod
environment:
- NEXT_PUBLIC_ENVIRONMENT
- NEXT_PUBLIC_API_URL
Expand All @@ -16,7 +16,7 @@ services:
backend:
build:
context: ./backend-app/
dockerfile: Dockerfile
dockerfile: Dockerfile.prod
environment:
- FASTAPI_SECRET_KEY
- FASTAPI_HASH_ALGORITHM
Expand Down
13 changes: 13 additions & 0 deletions frontend-app/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:slim

WORKDIR /app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "run", "dev"]

0 comments on commit 326a1e3

Please sign in to comment.