|
@ -7,20 +7,14 @@ RUN npm install --global corepack@latest |
|
|
# Install pnpm |
|
|
# Install pnpm |
|
|
RUN corepack enable pnpm |
|
|
RUN corepack enable pnpm |
|
|
|
|
|
|
|
|
# add build tools for argon2 |
|
|
|
|
|
RUN apk add --no-cache make gcc g++ python3 |
|
|
|
|
|
|
|
|
|
|
|
# Copy Web UI |
|
|
# Copy Web UI |
|
|
COPY src ./ |
|
|
COPY src/package.json src/pnpm-lock.yaml ./ |
|
|
RUN pnpm install |
|
|
RUN pnpm install |
|
|
|
|
|
|
|
|
# Build UI |
|
|
# Build UI |
|
|
|
|
|
COPY src ./ |
|
|
RUN pnpm build |
|
|
RUN pnpm build |
|
|
|
|
|
|
|
|
# Remove unnecessary node modules |
|
|
|
|
|
RUN find ./node_modules/.pnpm -mindepth 1 -maxdepth 1 -type d ! -name '@libsql+linux*' -exec rm -r {} + |
|
|
|
|
|
RUN find ./node_modules/@libsql -mindepth 1 -maxdepth 1 -type l ! -name 'linux*' -exec rm -r {} + |
|
|
|
|
|
|
|
|
|
|
|
# Copy build result to a new image. |
|
|
# Copy build result to a new image. |
|
|
# This saves a lot of disk space. |
|
|
# This saves a lot of disk space. |
|
|
FROM docker.io/library/node:lts-alpine |
|
|
FROM docker.io/library/node:lts-alpine |
|
@ -33,8 +27,7 @@ COPY --from=build /app/.output /app |
|
|
# Copy migrations |
|
|
# Copy migrations |
|
|
COPY --from=build /app/server/database/migrations /app/server/database/migrations |
|
|
COPY --from=build /app/server/database/migrations /app/server/database/migrations |
|
|
# libsql |
|
|
# libsql |
|
|
COPY --from=build /app/node_modules/.pnpm/ /app/node_modules/.pnpm/ |
|
|
RUN npm install --no-save libsql |
|
|
COPY --from=build /app/node_modules/@libsql /app/node_modules/@libsql |
|
|
|
|
|
|
|
|
|
|
|
# Install Linux packages |
|
|
# Install Linux packages |
|
|
RUN apk add --no-cache \ |
|
|
RUN apk add --no-cache \ |
|
|