2 Commits

Author SHA1 Message Date
c99017623b feat: add docker-compose stack with FrankenPHP 2025-12-02 15:32:23 +01:00
b1c26b762a feat: setup Dockerfile for frontend 2025-12-02 15:31:49 +01:00
4 changed files with 109 additions and 0 deletions

1
docker/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
mariadb_data/

63
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,63 @@
services:
isop-frontend:
container_name: isop-frontend
build:
context: ../frontend
dockerfile: Dockerfile
restart: unless-stopped
environment:
NUXT_HOST: 0.0.0.0
NUXT_PORT: 80
NUXT_PUBLIC_SANCTUM_BASE_URL: https://localhost
NUXT_PUBLIC_SANCTUM_ORIGINAL: http://localhost
ports:
- 80:80
depends_on:
- isop-backend
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost"]
start_period: 10s
interval: 1m
timeout: 5s
retries: 5
isop-backend:
container_name: isop-backend
image: dunglas/frankenphp
restart: unless-stopped
env_file:
- ../backend/.env
environment:
DB_CONNECTION: mariadb
DB_HOST: isop-database
DB_PORT: 3306
DB_DATABASE: isop
DB_USERNAME: root
DB_PASSWORD: admin
ports:
- 443:443
- 443:443/udp
volumes:
- ../backend:/app
depends_on:
isop-database:
condition: service_healthy
isop-database:
container_name: isop-database
image: mariadb:11.8.2-noble
restart: unless-stopped
cap_add:
# Allow memory binding
- SYS_NICE
environment:
MARIADB_DATABASE: "isop"
MARIADB_ROOT_PASSWORD: "admin"
volumes:
- ./mariadb_data:/var/lib/mysql
healthcheck:
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
start_period: 10s
interval: 1m
timeout: 5s
retries: 3

8
frontend/.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
.nuxt/
.output/
.env*
node_modules/
cypress/
cypress.config.ts
package-lock.json
*.md

37
frontend/Dockerfile Normal file
View File

@@ -0,0 +1,37 @@
# Build Stage 1
FROM node:22-alpine AS build
WORKDIR /app
RUN corepack enable
# Copy package.json and your lockfile
COPY package.json ./
# Install dependencies
RUN pnpm i
# Copy the entire project
COPY . ./
# Prepare Nuxt (generates .nuxt with type definitions and auto-imports)
RUN pnpm run postinstall
# Build the project
RUN pnpm run build
# Build Stage 2
FROM node:22-alpine
WORKDIR /app
# Only `.output` folder is needed from the build stage
COPY --from=build /app/.output/ ./
# Change the port and host
ENV PORT=80
ENV HOST=0.0.0.0
EXPOSE 80
CMD ["node", "/app/server/index.mjs"]