opral / monorepo

lix (change control system) && inlang (globalization ecosystem for software built on lix)
https://opral.com
Apache License 2.0
1.25k stars 111 forks source link

[bug] SDK can't locate settings in Docker Environment #2281

Closed LorisSigrist closed 7 months ago

LorisSigrist commented 9 months ago

Problem

From Discord

The Inlang SDK fails to locate the Inlang settings file in docker environments & crashes. It likely can't find a repository root either (which should still work for reading from FS)

Example Dockerfile:

FROM node:lts AS base
WORKDIR /app

COPY package.json package-lock.json ./

FROM base AS build-deps
RUN npm install --production=false

FROM build-deps AS build
COPY . .
RUN npm run build

FROM base AS runtime
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist

ENV HOST=0.0.0.0.0
ENV PORT=4321
EXPOSE 4321
CMD node ./dist/server/entry.mjs

Logs

Expected behavior

The SDK locates the settings

Reproduction

Read thread

Other information

Happened when using the Paraglide Astro integration (which just defers to the Vite plugin under the hood)

LorisSigrist commented 9 months ago

cc @opral/inlang-sdk

felixhaeberle commented 9 months ago

This is likely a bug where the docker virtual file system is not correctly mounted to the real fs, causing in "files do not exist". If true, this can only be fixed in the configuration from docker & not from inlang side.

The user should be informed to copy the complete /app directory into docker in order for this to work || copy at least the folders & files related to the inlang functionality (e.g. project.inlang dir, compiled messages output dir, ...).

Probably related: https://stackoverflow.com/a/48127041/6854385