diff --git a/apps/stremio-streaming-catalogs/compose.yaml b/apps/stremio-streaming-catalogs/compose.yaml index 6f029d8..7e43d78 100644 --- a/apps/stremio-streaming-catalogs/compose.yaml +++ b/apps/stremio-streaming-catalogs/compose.yaml @@ -6,21 +6,43 @@ services: build: context: https://github.com/rleroi/Stremio-Streaming-Catalogs-Addon.git dockerfile_inline: | - FROM node:22.17-alpine + # Build Vue app + FROM node:22.17-alpine AS build WORKDIR /app - COPY package*.json ./ - - # Install production dependencies only - RUN npm ci --omit=dev --ignore-scripts && \ - npm cache clean --force - - # Copy application files + # Copy Vue app files COPY vue ./vue - COPY index.js addon.js ./ + # Remove existing .env files in Vue directory if any + RUN rm -f ./vue/.env + RUN rm -f ./vue/.env.development + ENV VITE_APP_URL=https://${STREMIO_STREAMING_CATALOGS_HOSTNAME?} + RUN cd vue && npm ci && npm run build + + # Build final production image + FROM node:22.17-alpine AS production + RUN apk add --no-cache curl + WORKDIR /app + + # Copy app files + COPY index.js . + COPY addon.js . + COPY package*.json . + + # Copy built Vue app + COPY --from=build /app/vue/dist ./vue/dist + COPY --from=build /app/vue/package*.json ./vue/ + COPY --from=build /app/vue/public ./vue/public + + # Install production dependencies + RUN npm ci --only=production ENV NODE_ENV=production + EXPOSE ${PORT:-7700} + + HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:${PORT:-7700}/manifest.json || exit 1 + ENTRYPOINT ["npm", "start"] expose: - 7700 @@ -34,18 +56,11 @@ services: - "traefik.http.services.stremio-streaming-catalogs.loadbalancer.server.port=7700" - "traefik.http.routers.stremio-streaming-catalogs.middlewares=authelia@docker" healthcheck: - test: - [ - "CMD", - "wget", - "--quiet", - "--tries=1", - "--spider", - "http://localhost:7700/manifest.json", - ] + test: "curl -fSs http://localhost:7700/manifest.json || exit 1" interval: 30s - timeout: 10s + timeout: 3s retries: 3 + start_period: 5s profiles: - stremio-streaming-catalogs - all