Skip to content

Commit f3499ac

Browse files
fix(studio): fix Docker build (#1160)
Co-authored-by: Florian Greinacher <florian.greinacher@siemens.com> Co-authored-by: Ashish Padhy <ashishpadhy1729@gmail.com>
1 parent 907fdac commit f3499ac

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

.changeset/sour-waves-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@asyncapi/studio": patch
3+
---
4+
5+
Fix Docker build for AsyncAPI Studio

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ pnpm run dev
3838
pnpm run build:studio
3939
```
4040

41+
#### Build Studio for Docker
42+
43+
```
44+
docker build -f apps/studio/Dockerfile -t asyncapi/studio .
45+
```
46+
For instructions on running it please refer to this [doc](/apps/studio/README.md#using-it-via-docker).
47+
4148
#### Build the Design System for production
4249

4350
```

apps/studio/Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apk add --no-cache libc6-compat
99
RUN apk update
1010
# Set working directory
1111
WORKDIR /app
12-
RUN npm install --global turbo
12+
RUN npm install --global turbo@1
1313
COPY . .
1414
RUN turbo prune --scope=@asyncapi/studio --docker
1515

@@ -21,20 +21,20 @@ ARG BASE_URL_PLACEHOLDER
2121
RUN apk add --no-cache libc6-compat
2222
RUN apk update
2323
WORKDIR /app
24-
24+
RUN npm install --global pnpm@latest-10
25+
2526
# First install the dependencies (as they change less often)
2627

2728
COPY .gitignore .gitignore
2829
COPY --from=builder /app/out/json/ .
29-
COPY --from=builder /app/out/package-lock.json ./package-lock.json
30-
RUN PUPPETEER_SKIP_DOWNLOAD=true npm ci
31-
30+
RUN PUPPETEER_SKIP_DOWNLOAD=true pnpm install
31+
3232
# Build the project
3333
COPY --from=builder /app/out/full/ .
34-
RUN PUBLIC_URL=${BASE_URL_PLACEHOLDER} npm run build:studio
34+
RUN PUBLIC_URL=${BASE_URL_PLACEHOLDER} NEXT_CONFIG_OUTPUT=export pnpm run build:studio
3535

3636

37-
FROM docker.io/library/nginx:1.25.5-alpine as runtime
37+
FROM docker.io/library/nginx:1.25.5-alpine AS runtime
3838

3939
ARG BASE_URL_PLACEHOLDER
4040
# The base Nginx image automatically executes all shell scripts
@@ -49,4 +49,4 @@ COPY --from=installer /app/apps/studio/build /usr/share/nginx/html/
4949
# is configured we assume the application is running at '/'.
5050
RUN echo "find /usr/share/nginx/html/ -type f -print0 | xargs -0 sed -i \"s|${BASE_URL_PLACEHOLDER}|\${BASE_URL}|g\"" > $ENTRYPOINT_SCRIPT && chmod +x $ENTRYPOINT_SCRIPT
5151

52-
FROM runtime
52+
FROM runtime

apps/studio/next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const nextConfig = {
3636

3737
return config;
3838
},
39-
output: 'standalone',
39+
output: process.env.NEXT_CONFIG_OUTPUT ?? 'standalone',
4040
distDir: 'build'
4141
};
4242

apps/studio/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"./src/*",
2929
"./public/*"
3030
]
31-
}
31+
},
32+
"types": ["cypress"]
3233
},
3334
"include": [
3435
"next-env.d.ts",

0 commit comments

Comments
 (0)