|
|
@ -17,6 +17,10 @@ RUN pnpm install |
|
|
|
# Build UI |
|
|
|
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. |
|
|
|
# This saves a lot of disk space. |
|
|
|
FROM docker.io/library/node:lts-alpine |
|
|
@ -28,6 +32,9 @@ HEALTHCHECK CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q |
|
|
|
COPY --from=build /app/.output /app |
|
|
|
# Copy migrations |
|
|
|
COPY --from=build /app/server/database/migrations /app/server/database/migrations |
|
|
|
# libsql |
|
|
|
COPY --from=build /app/node_modules/.pnpm/ /app/node_modules/.pnpm/ |
|
|
|
COPY --from=build /app/node_modules/@libsql /app/node_modules/@libsql |
|
|
|
|
|
|
|
# Install Linux packages |
|
|
|
RUN apk add --no-cache \ |
|
|
@ -43,9 +50,6 @@ RUN apk add --no-cache \ |
|
|
|
RUN update-alternatives --install /usr/sbin/iptables iptables /usr/sbin/iptables-legacy 10 --slave /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-legacy-restore --slave /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-legacy-save |
|
|
|
RUN update-alternatives --install /usr/sbin/ip6tables ip6tables /usr/sbin/ip6tables-legacy 10 --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/ip6tables-legacy-restore --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/ip6tables-legacy-save |
|
|
|
|
|
|
|
# libsql |
|
|
|
RUN npm install libsql |
|
|
|
|
|
|
|
# Set Environment |
|
|
|
ENV DEBUG=Server,WireGuard,Database,CMD |
|
|
|
ENV PORT=51821 |
|
|
|