Files in the i18n directory are missing #4448

Closed
opened 2026-02-21 18:06:29 -05:00 by yindo · 2 comments
Owner

Originally created by @silence-pan84 on GitHub (Jul 4, 2024).

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

image
Docker deployed but missing file in container under i18n directory

2. Additional context or comments

No response

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @silence-pan84 on GitHub (Jul 4, 2024). ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. ![image](https://github.com/langgenius/dify/assets/174668054/27636241-391e-4ad8-a356-81857eea184a) Docker deployed but missing file in container under i18n directory ### 2. Additional context or comments _No response_ ### 3. Can you help us with this feature? - [ ] I am interested in contributing to this feature.
yindo added the 🐞 bug label 2026-02-21 18:06:29 -05:00
yindo closed this issue 2026-02-21 18:06:29 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 4, 2024):

To resolve the issue of missing files and directories in the /app/web/i18n directory of your Docker container, ensure that the files and directories are correctly copied into the container during the build process. Verify and update your Dockerfile to include the necessary COPY commands.

Here is an example of how you can modify your Dockerfile to copy the i18n directory into the container:

# base image
FROM node:20.11-alpine3.19 AS base
LABEL maintainer="takatost@gmail.com"

# if you located in China, you can use aliyun mirror to speed up
# RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories

RUN apk add --no-cache tzdata

# install packages
FROM base AS packages

WORKDIR /app/web

COPY package.json .
COPY yarn.lock .

# if you located in China, you can use taobao registry to speed up
# RUN yarn install --frozen-lockfile --registry https://registry.npmmirror.com/

RUN yarn install --frozen-lockfile

# build resources
FROM base AS builder
WORKDIR /app/web
COPY --from=packages /app/web/ .
COPY . .

RUN yarn build

# production stage
FROM base AS production

ENV NODE_ENV=production
ENV EDITION=SELF_HOSTED
ENV DEPLOY_ENV=PRODUCTION
ENV CONSOLE_API_URL=http://127.0.0.1:5001
ENV APP_API_URL=http://127.0.0.1:5001
ENV PORT=3000

# set timezone
ENV TZ=UTC
RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \
    && echo ${TZ} > /etc/timezone

# global runtime packages
RUN yarn global add pm2 \
    && yarn cache clean

WORKDIR /app/web
COPY --from=builder /app/web/public ./public
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static

# Ensure the i18n directory is copied
COPY --from=builder /app/web/i18n ./i18n

COPY docker/pm2.json ./pm2.json
COPY docker/entrypoint.sh ./entrypoint.sh

ARG COMMIT_SHA
ENV COMMIT_SHA=${COMMIT_SHA}

EXPOSE 3000
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]

Additionally, ensure that the .dockerignore file does not exclude the i18n directory. Here is an example of a .dockerignore file that does not exclude the i18n directory:

.env
.env.*

# Logs
logs
*.log*

# node
node_modules
.husky
.next

# vscode
.vscode

# webstorm
.idea
*.iml
*.iws
*.ipr

# Jetbrains
.idea

Make sure the COPY --from=builder /app/web/i18n ./i18n line is present and correctly points to the source and destination paths. This will ensure that the i18n directory and its contents are included in the Docker image and available in the container [1][2][3].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Jul 4, 2024): <!-- Answer --> To resolve the issue of missing files and directories in the `/app/web/i18n` directory of your Docker container, ensure that the files and directories are correctly copied into the container during the build process. Verify and update your Dockerfile to include the necessary `COPY` commands. Here is an example of how you can modify your Dockerfile to copy the `i18n` directory into the container: ```dockerfile # base image FROM node:20.11-alpine3.19 AS base LABEL maintainer="takatost@gmail.com" # if you located in China, you can use aliyun mirror to speed up # RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories RUN apk add --no-cache tzdata # install packages FROM base AS packages WORKDIR /app/web COPY package.json . COPY yarn.lock . # if you located in China, you can use taobao registry to speed up # RUN yarn install --frozen-lockfile --registry https://registry.npmmirror.com/ RUN yarn install --frozen-lockfile # build resources FROM base AS builder WORKDIR /app/web COPY --from=packages /app/web/ . COPY . . RUN yarn build # production stage FROM base AS production ENV NODE_ENV=production ENV EDITION=SELF_HOSTED ENV DEPLOY_ENV=PRODUCTION ENV CONSOLE_API_URL=http://127.0.0.1:5001 ENV APP_API_URL=http://127.0.0.1:5001 ENV PORT=3000 # set timezone ENV TZ=UTC RUN ln -s /usr/share/zoneinfo/${TZ} /etc/localtime \ && echo ${TZ} > /etc/timezone # global runtime packages RUN yarn global add pm2 \ && yarn cache clean WORKDIR /app/web COPY --from=builder /app/web/public ./public COPY --from=builder /app/web/.next/standalone ./ COPY --from=builder /app/web/.next/static ./.next/static # Ensure the i18n directory is copied COPY --from=builder /app/web/i18n ./i18n COPY docker/pm2.json ./pm2.json COPY docker/entrypoint.sh ./entrypoint.sh ARG COMMIT_SHA ENV COMMIT_SHA=${COMMIT_SHA} EXPOSE 3000 ENTRYPOINT ["/bin/sh", "./entrypoint.sh"] ``` Additionally, ensure that the `.dockerignore` file does not exclude the `i18n` directory. Here is an example of a `.dockerignore` file that does not exclude the `i18n` directory: ``` .env .env.* # Logs logs *.log* # node node_modules .husky .next # vscode .vscode # webstorm .idea *.iml *.iws *.ipr # Jetbrains .idea ``` Make sure the `COPY --from=builder /app/web/i18n ./i18n` line is present and correctly points to the source and destination paths. This will ensure that the `i18n` directory and its contents are included in the Docker image and available in the container <sup>[[1]](https://github.com/langgenius/dify/blob/main/web/i18n/README.md)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/web/Dockerfile)</sup><sup>[[3]](https://github.com/langgenius/dify/blob/main/web/.dockerignore)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Jul 4, 2024):

We're sorry, but we only keep some compiled content in our container service.

@crazywoola commented on GitHub (Jul 4, 2024): We're sorry, but we only keep some compiled content in our container service.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4448