Skip to content

Commit

Permalink
Update dockerfile setup
Browse files Browse the repository at this point in the history
  • Loading branch information
juffalow committed Mar 6, 2022
1 parent 8af7cac commit 58ec535
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
32 changes: 30 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,38 @@ RUN yarn install --frozen-lockfile && yarn build

FROM nginx:stable-alpine

RUN addgroup --gid 3000 --system juffgroup \
&& adduser --uid 2000 --system --ingroup juffgroup juffuser

RUN chown -R juffuser:juffgroup /etc/nginx/conf.d
RUN chown -R juffuser:juffgroup /var/log/nginx
RUN chown -R juffuser:juffgroup /var/cache/nginx
RUN chown -R juffuser:juffgroup /usr/share/nginx

RUN touch /var/run/nginx.pid && \
chown -R juffuser:juffgroup /var/run/nginx.pid

USER 2000:3000

COPY --from=build /home/node/react-relay-example/build /usr/share/nginx/html

RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
RUN echo $'\n\
server {\n\
listen 8080;\n\
location / {\n\
root /usr/share/nginx/html;\n\
index index.html index.htm;\n\
try_files $uri $uri/ /index.html;\n\
}\n\
error_page 500 502 503 504 /50x.html;\n\
location = /50x.html {\n\
root /usr/share/nginx/html;\n\
}\n\
}\n\
' > /etc/nginx/conf.d/default.conf

EXPOSE 8080

CMD ["nginx", "-g", "daemon off;"]
17 changes: 0 additions & 17 deletions nginx/nginx.conf

This file was deleted.

0 comments on commit 58ec535

Please sign in to comment.