chore: track deployment and expose frontend on LAN interfaces
This commit is contained in:
commit
db0f995997
7 files changed
+148
No files matched your search
@@ -0,0 +1,13 @@
|
||||
FROM node:18-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY hackathon-grading-system-front/package*.json ./
|
||||
RUN npm ci
|
||||
COPY hackathon-grading-system-front/ ./
|
||||
ENV API_BASE_URL=/api
|
||||
ENV NODE_OPTIONS=--openssl-legacy-provider
|
||||
RUN npm run generate
|
||||
|
||||
FROM nginx:alpine
|
||||
COPY deployment/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
@@ -0,0 +1,13 @@
|
||||
"""Create local Compose secrets once; keep existing credentials on subsequent runs."""
|
||||
from pathlib import Path
|
||||
import secrets
|
||||
|
||||
target = Path(__file__).resolve().parent.parent / '.env.local'
|
||||
if target.exists():
|
||||
print('.env.local already exists; keeping it.')
|
||||
else:
|
||||
target.touch(mode=0o600, exist_ok=False)
|
||||
target.write_text(''.join(f'{name}={secrets.token_hex(size)}\n' for name, size in [
|
||||
('MYSQL_PASSWORD', 24), ('MYSQL_ROOT_PASSWORD', 24), ('JWT_KEY', 48),
|
||||
]))
|
||||
print('Created .env.local.')
|
||||
@@ -0,0 +1,14 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
location /api/ {
|
||||
proxy_pass http://api:3080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user