dify/web/Dockerfile

50 lines
877 B
Docker
Raw Normal View History

# base image
FROM node:20.11.0-alpine AS base
2023-05-15 08:51:32 +08:00
# install packages
FROM base as packages
2023-05-15 08:51:32 +08:00
LABEL maintainer="takatost@gmail.com"
WORKDIR /app/web
COPY package.json .
COPY yarn.lock .
RUN yarn --only=prod
# 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
2023-05-15 08:51:32 +08:00
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
2023-05-15 08:51:32 +08:00
WORKDIR /app/web
2023-08-17 13:07:07 +08:00
COPY --from=builder /app/web/public ./public
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static
2023-05-15 08:51:32 +08:00
COPY docker/entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
2023-05-15 08:51:32 +08:00
ARG COMMIT_SHA
ENV COMMIT_SHA ${COMMIT_SHA}
EXPOSE 3000
ENTRYPOINT ["/bin/sh", "./entrypoint.sh"]