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
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,26 @@

## Running locally

### 1. Copy environment file (defaults work out of the box)
```bash
# 1. Copy environment file (defaults work out of the box)
cp .env-template .env
```

### 2. Start the application

#### 2.1. Full
```bash
docker compose -f infrastructure/local/docker-compose.yaml --profile full up -d
```

# 2. Start infrastructure (PostgreSQL + Keycloak)
#### 2.2 Backend + its infrastructure (PostgreSQL + Keycloak)
```bash
docker compose -f infrastructure/local/docker-compose.yaml --profile backend up -d
```

# 3. Backend
cd skyroster-backend
./mvnw spring-boot:run

#### 2.3 Frontend + its infrastructure (PostgreSQL + Keycloak)
```bash
docker compose -f infrastructure/local/docker-compose.yaml --profile frontend up -d
```

56 changes: 55 additions & 1 deletion infrastructure/local/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ services:
postgres:
image: postgres:17
container_name: skyroster-db
networks:
- skyroster-network
profiles:
- db
- frontend
- backend
- full
environment:
Expand All @@ -24,7 +27,10 @@ services:
keycloak:
image: quay.io/keycloak/keycloak:26.2
container_name: skyroster-keycloak
networks:
- skyroster-network
profiles:
- frontend
- backend
- full
environment:
Expand All @@ -43,5 +49,53 @@ services:
postgres:
condition: service_healthy

frontend:
build:
context: ../../skyroster-frontend
args:
VITE_API_URL: http://localhost:8000
container_name: skyroster-frontend
networks:
- skyroster-network
profiles:
- frontend
- full
ports:
- "5173:80"
volumes:
- ../../skyroster-frontend:/app
- /app/node_modules
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
keycloak:
condition: service_started

backend:
build:
context: ../../skyroster-backend
container_name: skyroster-backend
networks:
- skyroster-network
profiles:
- backend
- full
ports:
- "8001:8001"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${DB_NAME:-skyroster}
SPRING_DATASOURCE_USERNAME: ${DB_USERNAME:-skyroster}
SPRING_DATASOURCE_PASSWORD: ${DB_PASSWORD:-skyroster}
depends_on:
postgres:
condition: service_healthy
keycloak:
condition: service_started

volumes:
pgdata:
pgdata:

networks:
skyroster-network:
driver: bridge
2 changes: 2 additions & 0 deletions skyroster-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Stage 1: Build
FROM eclipse-temurin:25-jdk AS build
LABEL authors="Bartosz Janusz, Maksymilian Krywionek, Marcin Kuduk, Łukasz Lizak"

WORKDIR /app

# Copy Maven wrapper and POM for dependency caching
Expand Down
Empty file modified skyroster-backend/mvnw
100644 → 100755
Empty file.
8 changes: 8 additions & 0 deletions skyroster-frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Stage 1: Build
FROM node:22-alpine AS build
LABEL authors="Bartosz Janusz, Maksymilian Krywionek, Marcin Kuduk, Łukasz Lizak"

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

COPY . .

ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL

RUN npm run build

# Stage 2: Runtime
Expand All @@ -14,3 +20,5 @@ COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
Loading