Skip to content

Commit

Permalink
Merge pull request #67 from Nischal2015/chore/nginx-unprivileged
Browse files Browse the repository at this point in the history
Add nginx-unpriviliged dockerfile
  • Loading branch information
Nischal2015 authored Dec 17, 2023
2 parents f592e3b + 3abd64a commit cbcd266
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Dockerfile.nginx.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM node:18.7.0-alpine3.15 as build

WORKDIR /app

RUN addgroup app && \
adduser -S -G app app

COPY ["package.json", "yarn.lock", "./"]

RUN yarn

COPY . .

RUN yarn build

# 2nd stage
FROM nginx:1.23.3-alpine-slim

USER root

RUN rm /etc/nginx/conf.d/default.conf && \
rm /etc/nginx/nginx.conf && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/run && \
touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid

COPY --from=build /app/dist /usr/share/nginx/html
COPY .nginx/nginx.conf /etc/nginx/nginx.conf
COPY .nginx/conf.d /etc/nginx/conf.d

USER nginx

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]

1 comment on commit cbcd266

@vercel
Copy link

@vercel vercel bot commented on cbcd266 Dec 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nischalshakya – ./

nischalshakya-git-main-nischal2015.vercel.app
nischalshakya.vercel.app
nischalshakya-nischal2015.vercel.app

Please sign in to comment.