Skip to content

Commit acecc2f

Browse files
committed
fix demo deploy
1 parent cac60be commit acecc2f

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

Dockerfile.demo

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,9 @@ COPY . .
1414

1515
RUN pnpm -r build
1616

17-
FROM node:20-alpine AS runner
18-
WORKDIR /app
19-
20-
ENV NODE_ENV=production
21-
ENV PORT=4173
17+
FROM nginx:1.27-alpine AS runner
2218

23-
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
24-
25-
COPY --from=build /app /app
19+
COPY deploy/nginx-effects.conf /etc/nginx/conf.d/default.conf
20+
COPY --from=build /app/apps/demo/dist /usr/share/nginx/html/effects
2621

2722
EXPOSE 4173
28-
29-
CMD ["sh", "-c", "pnpm --filter @protohiro/effects-demo preview --host 0.0.0.0 --port ${PORT:-4173}"]

deploy/nginx-effects.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
server {
2+
listen 4173;
3+
server_name _;
4+
5+
root /usr/share/nginx/html;
6+
7+
location = /effects {
8+
return 301 /effects/;
9+
}
10+
11+
location /effects/assets/ {
12+
try_files $uri =404;
13+
}
14+
15+
location /effects/ {
16+
try_files $uri $uri/ /effects/index.html;
17+
}
18+
19+
location / {
20+
return 404;
21+
}
22+
}

0 commit comments

Comments
 (0)