Skip to content

Commit 2c261fd

Browse files
committed
improve setup
1 parent 2691c52 commit 2c261fd

File tree

4 files changed

+64
-51
lines changed

4 files changed

+64
-51
lines changed

epicshop/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM node:20-bookworm-slim as base
1+
FROM node:24-bookworm-slim as base
22

33
RUN apt-get update && apt-get install -y git
44

5+
ENV EPICSHOP_GITHUB_REPO=https://github.com/epicweb-dev/react-performance
56
ENV EPICSHOP_CONTEXT_CWD="/myapp/workshop-content"
67
ENV EPICSHOP_DEPLOYED="true"
78
ENV EPICSHOP_DISABLE_WATCHER="true"
@@ -11,11 +12,15 @@ ENV NODE_ENV="production"
1112

1213
WORKDIR /myapp
1314

15+
# Clone the workshop repo during build time, excluding database files
16+
RUN git clone --depth 1 ${EPICSHOP_GITHUB_REPO} ${EPICSHOP_CONTEXT_CWD}
17+
1418
ADD . .
1519

1620
RUN npm install --omit=dev
1721

18-
CMD rm -rf ${EPICSHOP_CONTEXT_CWD} && \
19-
git clone https://github.com/epicweb-dev/react-performance ${EPICSHOP_CONTEXT_CWD} && \
20-
cd ${EPICSHOP_CONTEXT_CWD} && \
21-
npx epicshop start
22+
RUN cd ${EPICSHOP_CONTEXT_CWD} && \
23+
npx epicshop warm
24+
25+
CMD cd ${EPICSHOP_CONTEXT_CWD} && \
26+
npx epicshop start

epicshop/fly.toml

Lines changed: 0 additions & 46 deletions
This file was deleted.

epicshop/fly.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
2+
#
3+
4+
app: 'epicweb-dev-react-performance'
5+
primary_region: sjc
6+
kill_signal: SIGINT
7+
kill_timeout: 5s
8+
swap_size_mb: 512
9+
10+
experimental:
11+
auto_rollback: true
12+
13+
attached:
14+
secrets: {}
15+
16+
services:
17+
- processes:
18+
- app
19+
protocol: tcp
20+
internal_port: 8080
21+
22+
ports:
23+
- port: 80
24+
25+
handlers:
26+
- http
27+
force_https: true
28+
- port: 443
29+
30+
handlers:
31+
- tls
32+
- http
33+
34+
concurrency:
35+
type: connections
36+
hard_limit: 100
37+
soft_limit: 80
38+
39+
tcp_checks:
40+
- interval: 15s
41+
timeout: 2s
42+
grace_period: 1s
43+
44+
http_checks:
45+
- interval: 10s
46+
timeout: 2s
47+
grace_period: 5s
48+
method: get
49+
path: /resources/healthcheck
50+
protocol: http
51+
tls_skip_verify: false

epicshop/setup-custom.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import path from 'node:path'
2+
import { warm } from '@epic-web/workshop-cli/warm'
23
import {
34
getApps,
45
isProblemApp,
56
setPlayground,
67
} from '@epic-web/workshop-utils/apps.server'
78
import fsExtra from 'fs-extra'
89

10+
await warm()
11+
912
const allApps = await getApps()
1013
const problemApps = allApps.filter(isProblemApp)
1114

0 commit comments

Comments
 (0)