You've already forked isop-mirror
Compare commits
22 Commits
develop
...
77e099a16e
| Author | SHA1 | Date | |
|---|---|---|---|
| 77e099a16e | |||
| 0da6157255 | |||
| f0ac4e0cdf | |||
| 679b6ab913 | |||
| a93c8d236a | |||
| 92782bfff3 | |||
| d052e464b2 | |||
| 962ae2d0d3 | |||
| 72bca8876e | |||
| 380cf51b77 | |||
| a6164cdcf0 | |||
| cbfd4f1b68 | |||
| be284c061e | |||
| e62fe4c443 | |||
| 187b56b464 | |||
| c99017623b | |||
| b1c26b762a | |||
| 77c4164dcb | |||
| 550f07df79 | |||
| 4714cc7892 | |||
| 042cdcdb3a | |||
| 79a8c4f229 |
9
backend/.dockerignore
Normal file
9
backend/.dockerignore
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
.git
|
||||||
|
.env
|
||||||
|
storage/logs/*
|
||||||
|
storage/framework/cache/*
|
||||||
|
storage/framework/sessions/*
|
||||||
|
storage/framework/views/*
|
||||||
|
bootstrap/cache/*
|
||||||
|
.phpunit.result.cache
|
||||||
|
vendor/*
|
||||||
18
backend/Dockerfile
Normal file
18
backend/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM dunglas/frankenphp:1.10-php8.4-bookworm
|
||||||
|
|
||||||
|
RUN install-php-extensions \
|
||||||
|
pdo_mysql \
|
||||||
|
gd \
|
||||||
|
intl \
|
||||||
|
zip \
|
||||||
|
opcache
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
ENV SERVER_NAME=:80
|
||||||
14
backend/docker/entrypoint.sh
Normal file
14
backend/docker/entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function exit_container_SIGTERM(){
|
||||||
|
echo "Caught SIGTERM"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
trap exit_container_SIGTERM SIGTERM
|
||||||
|
|
||||||
|
echo "Setting /app/public ownership..."
|
||||||
|
chgrp -R 33 /app
|
||||||
|
chown -hR 33:33 /app
|
||||||
|
|
||||||
|
echo "Starting PHP-FPM..."
|
||||||
|
php-fpm -F & wait
|
||||||
4
docker/.env.example
Normal file
4
docker/.env.example
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
BACKEND_URL=https://backend.example.com
|
||||||
|
FRONTEND_URL=https://example.com
|
||||||
|
SESSION_DOMAIN=.example.com
|
||||||
|
APP_KEY=SOME-KEY
|
||||||
2
docker/.gitignore
vendored
Normal file
2
docker/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
mariadb_data/
|
||||||
|
.env
|
||||||
84
docker/docker-compose.yml
Normal file
84
docker/docker-compose.yml
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
services:
|
||||||
|
isop-frontend:
|
||||||
|
container_name: isop-frontend
|
||||||
|
build:
|
||||||
|
context: ../frontend
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
NUXT_PUBLIC_SANCTUM_BASE_URL: ${BACKEND_URL:-https://backend.example.com}
|
||||||
|
NUXT_PUBLIC_SANCTUM_ORIGIN: ${FRONTEND_URL:-https://example.com}
|
||||||
|
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
|
||||||
|
build:
|
||||||
|
context: ../backend
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
APP_NAME: ISOP
|
||||||
|
APP_ENV: production
|
||||||
|
APP_KEY: ${APP_KEY:-SOME-KEY}
|
||||||
|
APP_DEBUG: false
|
||||||
|
APP_URL: ${FRONTEND_URL:-https://example.com}
|
||||||
|
FRONTEND_URL: ${FRONTEND_URL:-https://example.com}
|
||||||
|
SANCTUM_STATEFUL_DOMAINS: ${BACKEND_URL:-https://backend.example.com},${FRONTEND_URL:-https://example.com}
|
||||||
|
SESSION_DOMAIN: ${SESSION_DOMAIN:-.example.com} # Note the first dot
|
||||||
|
|
||||||
|
APP_LOCALE: sk
|
||||||
|
APP_FALLBACK_LOCALE: en_US
|
||||||
|
|
||||||
|
MAIL_MAILER: smtp
|
||||||
|
MAIL_HOST: smtp.example.com
|
||||||
|
MAIL_PORT: 2525
|
||||||
|
MAIL_USERNAME: username
|
||||||
|
MAIL_PASSWORD: password
|
||||||
|
MAIL_FROM_ADDRESS: "noreply@example.com"
|
||||||
|
MAIL_FROM_NAME: "ISOP"
|
||||||
|
|
||||||
|
DB_CONNECTION: mariadb
|
||||||
|
DB_HOST: isop-database
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_DATABASE: isop
|
||||||
|
DB_USERNAME: root
|
||||||
|
DB_PASSWORD: admin
|
||||||
|
ports:
|
||||||
|
- 8111:80
|
||||||
|
depends_on:
|
||||||
|
isop-database:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/api"]
|
||||||
|
start_period: 10s
|
||||||
|
interval: 1m
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
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
8
frontend/.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.nuxt/
|
||||||
|
.output/
|
||||||
|
.env*
|
||||||
|
node_modules/
|
||||||
|
cypress/
|
||||||
|
cypress.config.ts
|
||||||
|
package-lock.json
|
||||||
|
*.md
|
||||||
37
frontend/Dockerfile
Normal file
37
frontend/Dockerfile
Normal 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"]
|
||||||
@@ -22,8 +22,6 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
sanctum: {
|
sanctum: {
|
||||||
baseUrl: 'http://localhost:8000',
|
|
||||||
origin: 'http://localhost:3000',
|
|
||||||
redirect: {
|
redirect: {
|
||||||
onLogin: '/dashboard',
|
onLogin: '/dashboard',
|
||||||
onLogout: "/",
|
onLogout: "/",
|
||||||
@@ -34,6 +32,15 @@ export default defineNuxtConfig({
|
|||||||
redirectIfAuthenticated: true
|
redirectIfAuthenticated: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
runtimeConfig: {
|
||||||
|
public: {
|
||||||
|
sanctum: {
|
||||||
|
baseUrl: 'http://localhost:8000',
|
||||||
|
origin: 'http://localhost:3000'
|
||||||
|
} as any
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
typescript: {
|
typescript: {
|
||||||
strict: true,
|
strict: true,
|
||||||
typeCheck: true,
|
typeCheck: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user