forked from equinor/aware
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use node lts, split to two parts (#98)
- Loading branch information
1 parent
5183581
commit 40f3c63
Showing
2 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |