diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..dd12aa5 --- /dev/null +++ b/.env.example @@ -0,0 +1,13 @@ +# Database +DB_PASSWORD=your_secure_password_here + +# JWT Authentication +JWT_SECRET=your_jwt_secret_key_here + +# Korea Investment & Securities OpenAPI +KIS_APP_KEY=your_kis_app_key +KIS_APP_SECRET=your_kis_app_secret +KIS_ACCOUNT_NO=your_account_number + +# DART OpenAPI (Financial Statements) +DART_API_KEY=your_dart_api_key diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..f287691 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,22 @@ +FROM python:3.14-slim + +WORKDIR /app + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + gcc \ + libpq-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + +# Expose port +EXPOSE 8000 + +# Run the application +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..ae9fb9c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: '3.8' + +services: + postgres: + image: postgres:15-alpine + container_name: galaxy-po-db + environment: + POSTGRES_USER: galaxy + POSTGRES_PASSWORD: ${DB_PASSWORD:-devpassword} + POSTGRES_DB: galaxy_po + volumes: + - postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U galaxy -d galaxy_po"] + interval: 5s + timeout: 5s + retries: 5 + + backend: + build: + context: ./backend + dockerfile: Dockerfile + container_name: galaxy-po-backend + environment: + DATABASE_URL: postgresql://galaxy:${DB_PASSWORD:-devpassword}@postgres:5432/galaxy_po + JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret-change-in-production} + KIS_APP_KEY: ${KIS_APP_KEY:-} + KIS_APP_SECRET: ${KIS_APP_SECRET:-} + DART_API_KEY: ${DART_API_KEY:-} + ports: + - "8000:8000" + depends_on: + postgres: + condition: service_healthy + volumes: + - ./backend:/app + command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload + + frontend: + build: + context: ./frontend + dockerfile: Dockerfile + container_name: galaxy-po-frontend + environment: + NEXT_PUBLIC_API_URL: http://localhost:8000 + ports: + - "3000:3000" + depends_on: + - backend + volumes: + - ./frontend:/app + - /app/node_modules + - /app/.next + +volumes: + postgres_data: diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..ded2fd2 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,16 @@ +FROM node:24-alpine + +WORKDIR /app + +# Install dependencies +COPY package*.json ./ +RUN npm ci + +# Copy application code +COPY . . + +# Expose port +EXPOSE 3000 + +# Development command +CMD ["npm", "run", "dev"]