Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
services:
db:
image: postgres:15
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_DB=flashnotes
- POSTGRES_USER=flashnotes
- POSTGRES_PASSWORD=flashnotes
volumes:
- postgres_data:/var/lib/postgresql/data

backend:
build: ./backend
ports:
- "8000:8000"
depends_on:
- db
environment:
- PROJECT_NAME=FlashNotes
- DOMAIN=localhost
- POSTGRES_SERVER=db
- POSTGRES_USER=flashnotes
- POSTGRES_PASSWORD=flashnotes
- POSTGRES_DB=flashnotes
- FIRST_SUPERUSER=admin@example.com
- FIRST_SUPERUSER_PASSWORD=admin123
- USERS_OPEN_REGISTRATION=true
volumes:
- ./backend:/app
command: sh -c "./prestart.sh && uvicorn src.main:app --reload --host 0.0.0.0 --port 8000"

frontend:
build: ./frontend
ports:
- "5173:5173"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
command: pnpm run dev --host 0.0.0.0

volumes:
postgres_data:
19 changes: 19 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:18-alpine

WORKDIR /app

# Install pnpm
RUN npm install -g pnpm

# Copy package files
COPY package.json pnpm-lock.yaml ./

# Install dependencies
RUN pnpm install

# Copy source code
COPY . .

EXPOSE 5173

CMD ["pnpm", "run", "dev", "--host", "0.0.0.0"]