This commit is contained in:
Florian Forster
2025-08-05 13:54:23 -07:00
parent c33a79459b
commit 3e437575c2
13 changed files with 267 additions and 36 deletions

11
apps/console/Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM nginx:1.29.0
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid
USER nginx
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf
# TODO Needs work to be configured for the console app
COPY --chown=nginx:nginx dist/console /usr/share/nginx/html
EXPOSE 3001
ENTRYPOINT ["nginx", "-c", "/etc/nginx/nginx.conf"]
CMD ["-g", "daemon off;"]

69
apps/console/nginx.conf Normal file
View File

@@ -0,0 +1,69 @@
worker_processes auto;
pid /tmp/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logging
access_log off;
error_log /dev/stderr warn;
# Performance
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
keepalive_requests 1000;
# Compression
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_min_length 256;
gzip_comp_level 6;
gzip_types
text/plain
text/css
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/xml+rss
font/ttf
font/otf
image/svg+xml;
server {
listen 3001;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Angular Routing
location / {
try_files $uri $uri/ /index.html;
}
# Static Assets Caching
location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?|eot|ttf|svg|map)$ {
expires 1y;
access_log off;
add_header Cache-Control "public, immutable";
}
# Optional: Explicit asset route
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
}

View File

@@ -11,15 +11,15 @@
"lint:check:prettier": "prettier --check src",
"lint:fix": "prettier --write src",
"generate": "pnpm exec buf generate ../../proto --include-imports --include-wkt",
"clean": "rm -rf dist .angular .turbo node_modules src/app/proto/generated"
"clean": "rm -rf dist .angular node_modules src/app/proto/generated"
},
"nx": {
"release": {
"docker": {
"repositoryName": "zitadel/console"
}
},
"targets": {
"release": {
"docker": {
"repositoryName": "zitadel/console"
}
},
"generate": {
"outputs": [
"{projectRoot}/src/app/proto/generated/**"
@@ -33,10 +33,21 @@
"generate",
"@zitadel/client:build"
]
},
"docker:build": {
"dependsOn": ["build"]
},
"docker:run": {
"options": {
"args": [
"-p",
"3001:3001"
]
}
}
}
},
"dependencies": {
"dependencies": {
"@angular/animations": "^16.2.12",
"@angular/cdk": "^16.2.14",
"@angular/common": "^16.2.12",