Skip to content

Commit 29845f2

Browse files
official completion --fix prod
1 parent 05847ee commit 29845f2

File tree

5 files changed

+101
-10
lines changed

5 files changed

+101
-10
lines changed

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ load-plugins = [
167167
"pylint_per_file_ignores",
168168
]
169169
persistent = true
170-
suggestion-mode = true
171170
ignore = [
172171
"alembic",
173172
"venv",
@@ -219,6 +218,7 @@ disable = [
219218
[tool.pylint-per-file-ignores]
220219
"alembic/env.py" = "no-member"
221220
"conftest.py" = "import-outside-toplevel"
221+
"app/__main__.py" = "pointless-string-statement"
222222

223223
[tool.pylint.format]
224224
max-line-length = 95

frontend/src/pages/admin/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type ModalState =
2323
| { type: 'delete'; user: UserResponse }
2424

2525
export function Component(): React.ReactElement {
26-
const [page, setPage] = useState(PAGINATION.DEFAULT_PAGE)
26+
const [page, setPage] = useState<number>(PAGINATION.DEFAULT_PAGE)
2727
const [modal, setModal] = useState<ModalState>({ type: 'closed' })
2828

2929
const { data, isLoading } = useAdminUsers({

frontend/vite.config.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,25 @@ export default defineConfig(({ mode }) => {
4040
},
4141

4242
build: {
43-
target: 'ES2022',
43+
target: 'esnext',
44+
cssTarget: 'chrome100',
4445
sourcemap: isDev ? true : 'hidden',
45-
minify: 'esbuild',
46+
minify: 'oxc',
4647
rollupOptions: {
4748
output: {
48-
manualChunks: {
49-
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
50-
'vendor-query': ['@tanstack/react-query'],
51-
'vendor-state': ['zustand'],
49+
manualChunks(id: string): string | undefined {
50+
if (id.includes('node_modules')) {
51+
if (id.includes('react-dom') || id.includes('react-router')) {
52+
return 'vendor-react'
53+
}
54+
if (id.includes('@tanstack/react-query')) {
55+
return 'vendor-query'
56+
}
57+
if (id.includes('zustand')) {
58+
return 'vendor-state'
59+
}
60+
}
61+
return undefined
5262
},
5363
},
5464
},

infra/docker/frontend-builder.prod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ RUN rm -rf /usr/share/nginx/html/* && \
4141

4242
COPY --from=builder /app/dist /usr/share/nginx/html
4343

44-
COPY infra/nginx/nginx.conf /etc/nginx/nginx.conf
45-
COPY infra/nginx/prod.nginx /etc/nginx/conf.d/default.conf
44+
COPY --chown=nginx:nginx infra/nginx/nginx.prod.conf /etc/nginx/nginx.conf
45+
COPY --chown=nginx:nginx infra/nginx/prod.nginx /etc/nginx/conf.d/default.conf
4646

4747
RUN chown -R nginx:nginx /usr/share/nginx/html && \
4848
chown -R nginx:nginx /var/cache/nginx && \

infra/nginx/nginx.prod.conf

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# AngelaMos | 2025
2+
# nginx.prod.conf
3+
# Production nginx configuration (no dev frontend upstream)
4+
5+
worker_processes auto;
6+
worker_rlimit_nofile 65535;
7+
8+
error_log /var/log/nginx/error.log warn;
9+
pid /var/run/nginx.pid;
10+
11+
events {
12+
worker_connections 4096;
13+
multi_accept on;
14+
use epoll;
15+
}
16+
17+
http {
18+
include /etc/nginx/mime.types;
19+
default_type application/octet-stream;
20+
21+
# WebSocket upgrade handling
22+
map $http_upgrade $connection_upgrade {
23+
default upgrade;
24+
'' close;
25+
}
26+
27+
upstream backend {
28+
server backend:8000 max_fails=3 fail_timeout=30s;
29+
keepalive 32;
30+
keepalive_requests 1000;
31+
keepalive_timeout 60s;
32+
}
33+
34+
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=10r/s;
35+
limit_req_zone $binary_remote_addr zone=auth_limit:10m rate=1r/s;
36+
limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
37+
limit_req_status 429;
38+
39+
log_format main_timed '$remote_addr - $remote_user [$time_local] '
40+
'"$request" $status $body_bytes_sent '
41+
'"$http_referer" "$http_user_agent" '
42+
'rt=$request_time uct="$upstream_connect_time" '
43+
'uht="$upstream_header_time" urt="$upstream_response_time"';
44+
45+
sendfile on;
46+
tcp_nopush on;
47+
tcp_nodelay on;
48+
keepalive_timeout 65;
49+
types_hash_max_size 2048;
50+
server_tokens off;
51+
52+
# Buffer sizes
53+
client_body_buffer_size 128k;
54+
client_header_buffer_size 16k;
55+
client_max_body_size 10m;
56+
large_client_header_buffers 4 16k;
57+
58+
client_body_timeout 12s;
59+
client_header_timeout 12s;
60+
send_timeout 10s;
61+
62+
gzip on;
63+
gzip_vary on;
64+
gzip_proxied any;
65+
gzip_comp_level 6;
66+
gzip_min_length 256;
67+
gzip_types
68+
text/plain
69+
text/css
70+
text/xml
71+
text/javascript
72+
application/json
73+
application/javascript
74+
application/xml+rss
75+
application/atom+xml
76+
image/svg+xml;
77+
gzip_disable "msie6";
78+
79+
# Include server blocks
80+
include /etc/nginx/conf.d/*.conf;
81+
}

0 commit comments

Comments
 (0)