Skip to content

Commit 511e29c

Browse files
committed
improve setup
1 parent b512661 commit 511e29c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

epicshop/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ 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/e2e-react-application-testing-with-playwright
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 --depth 1 https://github.com/epicweb-dev/e2e-react-application-testing-with-playwright ${EPICSHOP_CONTEXT_CWD} && \
20-
cd ${EPICSHOP_CONTEXT_CWD} && \
22+
RUN cd ${EPICSHOP_CONTEXT_CWD} && \
23+
npx epicshop warm
24+
25+
CMD cd ${EPICSHOP_CONTEXT_CWD} && \
2126
npx epicshop start

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)