Skip to content

Commit

Permalink
build: add dockerfile for hanko-js
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyDevelop committed Jun 10, 2022
1 parent 7000e08 commit 4d97a58
Show file tree
Hide file tree
Showing 3 changed files with 20,503 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hanko-js/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:16.1.0-alpine as build

WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH

COPY package.json ./
COPY package-lock.json ./

RUN npm ci --silent
COPY . ./
RUN npm run build

FROM nginx:stable-alpine
COPY --from=build /app/dist/hanko.js /usr/share/nginx/html

COPY nginx/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
27 changes: 27 additions & 0 deletions hanko-js/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
listen 80;
server_name localhost;

server_tokens off;

location / {
root /usr/share/nginx/html;
# index index.html;
try_files $uri $uri/ @index;
}

location @index {
# add_header Cache-Control no-cache;
server_tokens off;
expires -1;
root /usr/share/nginx/html;
try_files /index.html =404;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
Loading

0 comments on commit 4d97a58

Please sign in to comment.