prod build fix
This commit is contained in:
21
README.md
21
README.md
@@ -1,18 +1,17 @@
|
|||||||
# RouterOS Backup Manager Next
|
# RouterOS Backup Manager Next
|
||||||
|
|
||||||
## Produkcja w Dockerze
|
## Deploy in docker
|
||||||
```bash
|
```bash
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
# uzupełnij SECRET_KEY i DEFAULT_ADMIN_PASSWORD
|
|
||||||
./start_prod.sh
|
|
||||||
```
|
```
|
||||||
Domyślnie frontend będzie dostępny na:
|
|
||||||
- `http://127.0.0.1:5581`
|
|
||||||
|
|
||||||
|
# edit SECRET_KEY & DEFAULT_ADMIN_PASSWORD
|
||||||
|
|
||||||
## Migracja starej bazy Flask/SQLite
|
`bash start_prod.sh`
|
||||||
Jeżeli masz starą bazę `backup_routeros.db`, możesz zaimportować dane:
|
|
||||||
```bash
|
or
|
||||||
cd backend
|
|
||||||
PYTHONPATH=. python scripts/migrate_legacy_sqlite.py /sciezka/do/backup_routeros.db
|
`docker compose up -d`
|
||||||
```
|
|
||||||
|
## Default app port:
|
||||||
|
`http://127.0.0.1:5581`
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ WORKDIR /app
|
|||||||
COPY frontend/package*.json /app/
|
COPY frontend/package*.json /app/
|
||||||
RUN npm ci || npm install
|
RUN npm ci || npm install
|
||||||
COPY frontend /app
|
COPY frontend /app
|
||||||
RUN npm run build
|
RUN npm run build:prod
|
||||||
|
|
||||||
FROM nginx:1.29-alpine
|
FROM nginx:mainline
|
||||||
COPY frontend/nginx/default.conf /etc/nginx/conf.d/default.conf
|
COPY frontend/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY --from=build /app/dist/routeros-backup-manager-next-ui/browser /usr/share/nginx/html
|
COPY --from=build /app/dist/routeros-backup-manager-next-ui/browser /usr/share/nginx/html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|||||||
@@ -14,22 +14,62 @@
|
|||||||
"outputPath": "dist/routeros-backup-manager-next-ui",
|
"outputPath": "dist/routeros-backup-manager-next-ui",
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"browser": "src/main.ts",
|
"browser": "src/main.ts",
|
||||||
"polyfills": ["zone.js"],
|
"polyfills": [
|
||||||
|
"zone.js"
|
||||||
|
],
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"assets": ["src/favicon.ico", "src/assets"],
|
"assets": [
|
||||||
|
"src/favicon.ico",
|
||||||
|
"src/assets"
|
||||||
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
"node_modules/primeicons/primeicons.css",
|
"node_modules/primeicons/primeicons.css",
|
||||||
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
|
"node_modules/primeng/resources/themes/lara-light-blue/theme.css",
|
||||||
"node_modules/primeng/resources/primeng.min.css",
|
"node_modules/primeng/resources/primeng.min.css",
|
||||||
"src/styles.css"
|
"src/styles.css"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"optimization": true,
|
||||||
|
"outputHashing": "all",
|
||||||
|
"sourceMap": false,
|
||||||
|
"extractLicenses": true,
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "1mb",
|
||||||
|
"maximumError": "2mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "10kb",
|
||||||
|
"maximumError": "20kb"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"optimization": false,
|
||||||
|
"sourceMap": true,
|
||||||
|
"extractLicenses": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "production"
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"buildTarget": "routeros-backup-manager-next-ui:build"
|
"buildTarget": "routeros-backup-manager-next-ui:build"
|
||||||
}
|
},
|
||||||
|
"configurations": {
|
||||||
|
"production": {
|
||||||
|
"buildTarget": "routeros-backup-manager-next-ui:build:production"
|
||||||
|
},
|
||||||
|
"development": {
|
||||||
|
"buildTarget": "routeros-backup-manager-next-ui:build:development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultConfiguration": "development"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
"start": "ng serve --host 127.0.0.1 --port 4200 --proxy-config proxy.conf.json",
|
"start": "ng serve --host 127.0.0.1 --port 4200 --proxy-config proxy.conf.json",
|
||||||
"start:lan": "ng serve --host 0.0.0.0 --port 4200 --proxy-config proxy.conf.json",
|
"start:lan": "ng serve --host 0.0.0.0 --port 4200 --proxy-config proxy.conf.json",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"test": "ng test"
|
"test": "ng test",
|
||||||
|
"build:prod": "ng build --configuration production",
|
||||||
|
"build:dev": "ng build --configuration development"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^17.3.0",
|
"@angular/animations": "^17.3.0",
|
||||||
|
|||||||
@@ -8,11 +8,6 @@ upstream backend_upstream {
|
|||||||
keepalive 16;
|
keepalive 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
map $uri $static_file {
|
|
||||||
~*\.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ 1;
|
|
||||||
default 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
@@ -53,13 +48,13 @@ server {
|
|||||||
proxy_pass http://backend_upstream/redoc;
|
proxy_pass http://backend_upstream/redoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ {
|
||||||
|
proxy_pass http://frontend_upstream;
|
||||||
|
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://frontend_upstream;
|
proxy_pass http://frontend_upstream;
|
||||||
|
|
||||||
if ($static_file) {
|
|
||||||
add_header Cache-Control "public, max-age=31536000, immutable" always;
|
|
||||||
}
|
|
||||||
|
|
||||||
add_header Cache-Control "no-store, no-cache" always;
|
add_header Cache-Control "no-store, no-cache" always;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user