Skip to content

Commit b341f21

Browse files
authored
fix: support BASE_URL for studio docker builds (#1208)
Co-authored-by: Antoine Auger <antoineauger@users.noreply.github.com>
1 parent a05019b commit b341f21

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

apps/studio/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use a UUID as placeholder value to have a unique string to replace.
2-
ARG BASE_URL_PLACEHOLDER=189b303e-37a0-4f6f-8c0a-50333bc3c36e
2+
ARG BASE_URL_PLACEHOLDER=/189b303e-37a0-4f6f-8c0a-50333bc3c36e
33

44

55
FROM node:18-alpine AS base
@@ -43,7 +43,7 @@ ARG BASE_URL_PLACEHOLDER
4343
# https://github.com/nginxinc/docker-nginx/blob/master/entrypoint/docker-entrypoint.sh#L16.
4444
ARG ENTRYPOINT_SCRIPT=/docker-entrypoint.d/set-public-url.sh
4545

46-
COPY --from=installer /app/apps/studio/build /usr/share/nginx/html/
46+
COPY --from=installer --chown=nginx:nginx /app/apps/studio/build /usr/share/nginx/html/
4747
# Add an entrypoint script that replaces all occurrences of the
4848
# placeholder value by the configured base URL. If no base URL
4949
# is configured we assume the application is running at '/'.

apps/studio/next.config.js

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

3737
return config;
3838
},
39+
basePath: process.env.PUBLIC_URL ?? '',
3940
output: process.env.NEXT_CONFIG_OUTPUT ?? 'standalone',
4041
distDir: 'build'
4142
};

apps/studio/src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export const metadata : Metadata = {
3434
images: ['/img/meta-studio-og-image.jpeg'],
3535
},
3636
icons: {
37-
icon: '/favicon.ico',
38-
apple: '/favicon-194x194.png',
37+
icon: `${process.env.PUBLIC_URL ?? ''}/favicon.ico`,
38+
apple: `${process.env.PUBLIC_URL ?? ''}/favicon-194x194.png`,
3939
},
4040
};
4141

0 commit comments

Comments
 (0)