Skip to content

Commit

Permalink
use node lts, split to two parts (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
audunsolemdal authored Oct 30, 2024
1 parent 5183581 commit 40f3c63
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
17 changes: 11 additions & 6 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM node:22-alpine
RUN npm install -g serve
FROM node:lts-alpine AS nodebuilder
WORKDIR /code

COPY package.json yarn.lock /code/
COPY --link package.json yarn.lock /code/
RUN yarn install --frozen-lockfile
COPY public /code/public
COPY src /code/src

COPY --link public /code/public
COPY --link src /code/src
RUN yarn build

FROM node:lts-alpine AS final

RUN npm install -g serve
COPY --link --from=nodebuilder /code/build /code/build
COPY --link /nginx.conf /etc/nginx/nginx.conf

EXPOSE 3000

CMD ["serve", "-s", "build"]
25 changes: 25 additions & 0 deletions web/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
events{}

http {

include /etc/nginx/mime.types;

server {
listen 3000;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "same-origin";
add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";
# TODO - tighten up the Content-Security-Policy
add_header Content-Security-Policy "default-src 'self' *; script-src 'self' 'unsafe-inline' *; style-src 'self' 'unsafe-inline' *; frame-ancestors 'self';";
# TODO - increase age
add_header Strict-Transport-Security "max-age=7200; includeSubDomains;";

location / {
try_files $uri $uri/ /index.html;
}
}
}

0 comments on commit 40f3c63

Please sign in to comment.