-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add production ready nginx docker image (#20)
* Add build image * Add working bitnami/nginx image * Remove unnecessary comments * Refactor the CI workflow * Fix yarn caching and github actions timeout issue * Fix workfloww trigger * Remove yarn.lock file * Fix yarn install timeout * Fix docker image build trigger * Revert "Remove yarn.lock file" This reverts commit 1076932. * Revert removal of yarn lock * Increase yarn install timeout * Increase yarn install timeout * Change docker build image * Add nginx conf * Cleanup nginx.conf * Remove yarn.lock * Revert "Remove yarn.lock" This reverts commit 51476e3. * Fix workflow trigger * Fix docker cpu architecture * Fix docker cpu architecture --------- Co-authored-by: Radovan Tomasik <[email protected]>
- Loading branch information
1 parent
54dfe7a
commit d24de79
Showing
6 changed files
with
2,006 additions
and
1,909 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.github | ||
oidc_mock | ||
tests |
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
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,15 @@ | ||
FROM node:19-alpine | ||
RUN apk update | ||
RUN apk upgrade | ||
RUN apk add bash curl yarn | ||
RUN yarn add vite | ||
FROM node:20.1.0-alpine as build-stage | ||
WORKDIR /app | ||
COPY . /app | ||
COPY ./dist /app | ||
RUN chown -R 1001:1001 /app | ||
EXPOSE 8080 | ||
RUN chmod +x start.sh | ||
COPY . . | ||
RUN yarn install --network-timeout 1000000000 --ignore-engines | ||
RUN yarn build | ||
|
||
FROM bitnami/nginx:1.24 as production-stage | ||
WORKDIR /app | ||
COPY --from=build-stage /app/dist . | ||
COPY nginx.conf /opt/bitnami/nginx/conf/server_blocks/my_server_block.conf | ||
COPY start.sh . | ||
USER 0 | ||
RUN chmod -R g+rwx /app | ||
USER 1001 | ||
CMD [ "./start.sh" ] | ||
CMD ["./start.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server { | ||
listen 8080; | ||
server_name localhost; | ||
root /app; | ||
index index.html; | ||
|
||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
add_header Cache-Control "no-cache"; | ||
} | ||
|
||
location ^~ /config/ { | ||
add_header Cache-Control "no-cache"; | ||
add_header X-Content-Type-Options nosniff; | ||
} | ||
|
||
location ~ \.(css|js)$ { | ||
expires max; | ||
add_header Cache-Control "public"; | ||
add_header X-Content-Type-Options nosniff; | ||
} | ||
} |
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
Oops, something went wrong.