-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e3a7fa
commit bb30e05
Showing
3 changed files
with
17 additions
and
5 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,12 +1,24 @@ | ||
FROM nginx:stable-alpine | ||
|
||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
ADD build /usr/share/nginx/html | ||
|
||
RUN rm etc/nginx/conf.d/default.conf | ||
COPY nginx.conf etc/nginx/conf.d/ | ||
|
||
# add non-root user | ||
RUN touch /var/run/nginx.pid | ||
RUN chown -R nginx:nginx /var/run/nginx.pid /usr/share/nginx/html /var/cache/nginx /var/log/nginx /etc/nginx/conf.d | ||
|
||
# non root users cannot listen on 80 | ||
EXPOSE 8080 | ||
|
||
USER nginx | ||
|
||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
RUN chmod 755 /entrypoint.sh | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
# Start Nginx server | ||
ENTRYPOINT sh -c "./entrypoint.sh && nginx -g 'daemon off;'" | ||
RUN chmod +x entrypoint.sh |
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,5 +1,5 @@ | ||
server { | ||
listen 80 default_server; | ||
listen 8080; | ||
server_name /usr/share/nginx/html; | ||
|
||
root /usr/share/nginx/html; | ||
|
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