OcDash Deploy commited on
Commit
45f0922
·
1 Parent(s): 2777a2e

fix: restore start.sh

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -10
  2. start.sh +0 -1
Dockerfile CHANGED
@@ -1,12 +1,9 @@
1
- FROM node:20-alpine AS base
2
- WORKDIR /app
3
- COPY package.json ./
4
- RUN npm install
5
- COPY . .
6
- RUN npm run build
7
-
8
  FROM nginx:alpine
9
- COPY --from=base /app/dist /usr/share/nginx/html
10
  COPY nginx.conf /etc/nginx/conf.d/default.conf
11
- EXPOSE 80
12
- CMD ["nginx", "-g", "daemon off;"]
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM nginx:alpine
2
+ COPY . /usr/share/nginx/html
3
  COPY nginx.conf /etc/nginx/conf.d/default.conf
4
+ COPY start.sh /start.sh
5
+ RUN rm -f /usr/share/nginx/html/Dockerfile /usr/share/nginx/html/nginx.conf /usr/share/nginx/html/README.md /usr/share/nginx/html/start.sh /usr/share/nginx/html/.gitignore 2>/dev/null; \
6
+ rm -rf /usr/share/nginx/html/.git 2>/dev/null; \
7
+ chmod +x /start.sh
8
+ EXPOSE 8080
9
+ CMD ["/start.sh"]
start.sh CHANGED
@@ -1,5 +1,4 @@
1
  #!/bin/sh
2
- # Inject HF_TOKEN from environment into index.html for the SPA
3
  if [ -n "$HF_TOKEN" ]; then
4
  sed -i "s|</head>|<script>window.__HF_TOKEN__ = '$HF_TOKEN';</script></head>|" /usr/share/nginx/html/index.html
5
  fi
 
1
  #!/bin/sh
 
2
  if [ -n "$HF_TOKEN" ]; then
3
  sed -i "s|</head>|<script>window.__HF_TOKEN__ = '$HF_TOKEN';</script></head>|" /usr/share/nginx/html/index.html
4
  fi