Skip to content

Commit f856ada

Browse files
author
teable-bot
committed
[sync] fix: docker build issues and TypeScript errors (#1098)
Synced from teableio/teable-ee@5c192b7
1 parent 4f4c0f2 commit f856ada

File tree

3 files changed

+23
-46
lines changed

3 files changed

+23
-46
lines changed

apps/nextjs-app/sentry.server.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
import * as Sentry from '@sentry/nextjs';
66

77
Sentry.init({
8+
release: process.env.NEXT_PUBLIC_BUILD_VERSION,
89
dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN,
910

1011
// Adjust this value in production, or use tracesSampler for greater control
1112
tracesSampleRate: 1,
1213

1314
// Setting this option to true will print useful information to the console while you're setting up Sentry.
1415
debug: false,
16+
17+
// Skip Sentry's built-in OpenTelemetry setup to avoid conflicts with custom OTEL SDK
18+
skipOpenTelemetrySetup: true,
1519
});

dockers/teable/Dockerfile

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ RUN set -ex; \
6161
# Stage 3: Post Builder #
6262
##################################################################
6363

64-
FROM builder as post-builder
64+
FROM builder AS post-builder
6565

6666
ENV NODE_ENV=production
6767

@@ -89,6 +89,8 @@ RUN set -ex; \
8989
# Stage 4: Extract a minimal image from the build #
9090
##################################################################
9191

92+
FROM tianon/gosu:1.19 AS gosu
93+
9294
FROM node:${NODE_VERSION}-bookworm-slim AS runner
9395

9496
ENV TZ=UTC \
@@ -104,40 +106,16 @@ RUN set -ex; \
104106
apt-get update; \
105107
apt-get install -y --no-install-recommends \
106108
curl \
109+
ca-certificates \
107110
openssl \
111+
netcat-traditional \
112+
wget \
108113
; \
109-
rm -rf /var/lib/apt/lists/*
110-
111-
# install gosu for a better su+exec command
112-
# https://github.com/tianon/gosu/blob/master/INSTALL.md
113-
ENV GOSU_VERSION 1.17
114-
RUN set -eux; \
115-
# save list of currently installed packages for later so we can clean up
116-
savedAptMark="$(apt-mark showmanual)"; \
117-
apt-get update; \
118-
apt-get install -y --no-install-recommends ca-certificates gnupg wget; \
119-
rm -rf /var/lib/apt/lists/*; \
120-
\
121-
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
122-
wget -nv -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
123-
wget -nv -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
124-
\
125-
# verify the signature
126-
export GNUPGHOME="$(mktemp -d)"; \
127-
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
128-
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
129-
gpgconf --kill all; \
130-
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
131-
\
132-
# clean up fetch dependencies
133-
apt-mark auto '.*' > /dev/null; \
134-
[ -z "$savedAptMark" ] || apt-mark manual $savedAptMark; \
135-
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
136-
\
137-
chmod +x /usr/local/bin/gosu; \
138-
# verify that the binary works
139-
gosu --version; \
140-
gosu nobody true
114+
rm -rf /var/lib/apt/lists/*; \
115+
ln -s /usr/local/lib/node_modules /node_modules
116+
117+
# gosu for better su+exec command (multi-stage copy from official image)
118+
COPY --from=gosu /gosu /usr/local/bin/gosu
141119

142120
WORKDIR /app
143121

@@ -179,19 +157,6 @@ COPY --chown=nodejs:nodejs scripts/wait-for ./scripts/wait-for
179157

180158
ENV BUILD_VERSION=$BUILD_VERSION
181159

182-
RUN set -ex; \
183-
npm install -g zx; \
184-
apt-get update; \
185-
apt-get install -y --no-install-recommends \
186-
curl \
187-
ca-certificates \
188-
openssl \
189-
netcat-traditional \
190-
wget \
191-
; \
192-
rm -rf /var/lib/apt/lists/*; \
193-
ln -s /usr/local/lib/node_modules /node_modules
194-
195160
EXPOSE ${PORT}
196161

197162
ENTRYPOINT ["scripts/start.sh"]

plugins/src/types.d/assets.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare module '*.ico' {
2+
const content: {
3+
src: string;
4+
height: number;
5+
width: number;
6+
};
7+
export default content;
8+
}

0 commit comments

Comments
 (0)