add frontend docker
This commit is contained in:
parent
44ac39ee5a
commit
c0a56065c7
2 changed files with 26 additions and 0 deletions
10
Dockerfile.frontend
Normal file
10
Dockerfile.frontend
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
FROM --platform=$BUILDPLATFORM node:24.14-alpine@sha256:7fddd9ddeae8196abf4a3ef2de34e11f7b1a722119f91f28ddf1e99dcafdf114 AS build
|
||||
WORKDIR /app
|
||||
COPY ./frontend ./
|
||||
RUN yarn install --immutable && \
|
||||
yarn build
|
||||
|
||||
FROM cgr.dev/chainguard/nginx@sha256:770994a6d14bfd17a34fcf0503e13f5f7c4cf6327b0ec6636f4607cb7dd91afc
|
||||
WORKDIR /usr/share/nginx/html
|
||||
COPY --from=build /app/dist/ .
|
||||
COPY container/nginx.conf /etc/nginx/conf.d/nginx.default.conf
|
||||
16
container/nginx.conf
Normal file
16
container/nginx.conf
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
server {
|
||||
listen 8080;
|
||||
server_name localhost;
|
||||
|
||||
add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; frame-ancestors 'none'; object-src 'none'; img-src 'self' data: blob:; font-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; connect-src 'self'; manifest-src 'self'; worker-src 'self' blob:; media-src 'self' blob:;" always;
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header X-Frame-Options "DENY" always;
|
||||
add_header X-XSS-Protection "1; mode=block" always;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue