mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 07:11:03 -04:00
Merge 4eaa75c843
into e86fd96ae3
This commit is contained in:
commit
d7046eacf7
2 changed files with 19 additions and 2 deletions
|
@ -13,5 +13,7 @@ RUN pnpm build
|
||||||
FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage
|
FROM nginxinc/nginx-unprivileged:stable-alpine AS production-stage
|
||||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80
|
COPY startup.sh /docker-entrypoint.d/startup.sh
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
ENV PORT 80
|
||||||
|
EXPOSE ${PORT}
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
15
startup.sh
Executable file
15
startup.sh
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Generate the nginx.conf with PORT env or default to 80
|
||||||
|
cat > /etc/nginx/conf.d/default.conf <<EOF
|
||||||
|
server {
|
||||||
|
listen ${PORT:-80};
|
||||||
|
server_name localhost;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files \$uri \$uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
Loading…
Add table
Add a link
Reference in a new issue