diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f68da3e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Continuous Integration + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.13" + + - name: Install backend dependencies + working-directory: backend + run: pip install -r requirements.txt + + - name: Verify backend import + working-directory: backend + env: + SECRET_KEY: test-secret-key + ALGORITHM: HS256 + ACCESS_TOKEN_EXPIRE_MINUTES: 30 + run: python -c "from app import main" + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "22" + + - name: Install frontend dependencies + working-directory: frontend + run: npm ci + + - name: Build frontend + working-directory: frontend + run: npm run build \ No newline at end of file diff --git a/README.md b/README.md index cb2fbf6..900542f 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,43 @@ Frontend körs normalt på `http://localhost:5173`. Frontend använder `/api` som standard. I lokal utveckling proxas det automatiskt till `http://localhost:8000` via `frontend/vite.config.ts`. +## Docker Compose + +När Docker-stödet är på plats kan projektet startas med Docker Compose istället för att köra backend och frontend var för sig. + +### Starta projektet + +```bash +docker compose up --build +``` + +Detta bygger images vid behov och startar alla services som behövs för lokal utveckling. + +### Portar + +- Frontend: `http://localhost:5173` +- Backend: `http://localhost:8000` + +### Stoppa containrarna + +```bash +docker compose down +``` + +### Vanliga Docker-kommandon + +```bash +docker compose up --build +docker compose down +docker compose logs +docker compose logs -f +docker compose build +``` + +Tips: +- Använd `docker compose logs -f` för att följa loggar i realtid. +- Kör `docker compose build` om du har ändrat en Dockerfile eller beroenden. + ## Miljövariabler ### Backend