Skip to content

Commit b95e196

Browse files
committed
fix(studio): fix Docker build
1 parent b696d79 commit b95e196

File tree

4 files changed

+55
-49
lines changed

4 files changed

+55
-49
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

apps/studio/Dockerfile

Lines changed: 7 additions & 7 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,18 +21,18 @@ 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
35-
34+
RUN PUBLIC_URL=${BASE_URL_PLACEHOLDER} NEXT_CONFIG_OUTPUT=export pnpm run build:studio
35+
3636

3737
FROM docker.io/library/nginx:1.25.5-alpine as runtime
3838

apps/studio/next.config.js

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
webpack: (
4-
config,
5-
{ buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }
6-
) => {
7-
config.module.rules.push({
8-
test: /\.yml$/i,
9-
type: 'asset/source',
10-
});
11-
12-
if (isServer) return config;
13-
// Important: return the modified config
14-
config.resolve.fallback = {
15-
...config.resolve.fallback,
16-
assert: require.resolve('assert/'),
17-
buffer: require.resolve('buffer'),
18-
http: require.resolve('stream-http'),
19-
https: require.resolve('https-browserify'),
20-
path: require.resolve('path-browserify'),
21-
stream: require.resolve('stream-browserify'),
22-
zlib: require.resolve('browserify-zlib'),
23-
url: require.resolve('url/'),
24-
util: require.resolve('util/'),
25-
debug: false,
26-
canvas: false,
27-
fs: false,
28-
};
29-
30-
config.plugins.push(
31-
new webpack.ProvidePlugin({
32-
process: 'process/browser',
33-
Buffer: ['buffer', 'Buffer'],
34-
})
35-
);
36-
37-
return config;
38-
},
39-
output: 'standalone',
40-
distDir: 'build'
41-
};
42-
43-
module.exports = nextConfig;
3+
webpack: (
4+
config,
5+
{ buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }
6+
) => {
7+
config.module.rules.push({
8+
test: /\.yml$/i,
9+
type: 'asset/source',
10+
});
11+
12+
if (isServer) return config;
13+
// Important: return the modified config
14+
config.resolve.fallback = {
15+
...config.resolve.fallback,
16+
assert: require.resolve('assert/'),
17+
buffer: require.resolve('buffer'),
18+
http: require.resolve('stream-http'),
19+
https: require.resolve('https-browserify'),
20+
path: require.resolve('path-browserify'),
21+
stream: require.resolve('stream-browserify'),
22+
zlib: require.resolve('browserify-zlib'),
23+
url: require.resolve('url/'),
24+
util: require.resolve('util/'),
25+
debug: false,
26+
canvas: false,
27+
fs: false,
28+
};
29+
30+
config.plugins.push(
31+
new webpack.ProvidePlugin({
32+
process: 'process/browser',
33+
Buffer: ['buffer', 'Buffer'],
34+
})
35+
);
36+
37+
return config;
38+
},
39+
output: process.env.NEXT_CONFIG_OUTPUT ?? 'standalone',
40+
distDir: 'build'
41+
};
42+
43+
module.exports = nextConfig;

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)