diff --git a/Dockerfile b/Dockerfile index 81f35fd..e49c873 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ WORKDIR /app RUN npm install -g pnpm +# Environment Variables ARG DATABASE_URL ARG SMTP_HOST ARG SMTP_PORT @@ -49,6 +50,12 @@ COPY --from=builder /app/prisma ./prisma RUN pnpm install --prod --frozen-lockfile +# Health check +HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1 + +# Expose the application port EXPOSE 3000 +# Start the application CMD ["node", "build"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 9f54395..0cefa68 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,14 +31,8 @@ services: - 'traefik.http.middlewares.youtubepedia-ws.headers.customrequestheaders.Upgrade=websocket' - 'traefik.http.middlewares.youtubepedia-ws.headers.customrequestheaders.Connection=Upgrade' - 'traefik.http.routers.youtubepedia.middlewares=youtubepedia-ws' - # CORS Headers - - 'traefik.http.middlewares.youtubepedia-cors.headers.accesscontrolallowmethods=GET,POST,PUT,DELETE,OPTIONS' - - 'traefik.http.middlewares.youtubepedia-cors.headers.accesscontrolalloworiginlist=*' - - 'traefik.http.middlewares.youtubepedia-cors.headers.accesscontrolallowcredentials=true' - - 'traefik.http.middlewares.youtubepedia-cors.headers.accesscontrolallowheaders=*' - - 'traefik.http.routers.youtubepedia.middlewares=youtubepedia-ws,youtubepedia-cors' networks: proxy: external: false - name: proxy \ No newline at end of file + name: proxy