diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index f670b8bb7..f76c8ee61 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -13,7 +13,7 @@ android { compileSdk = 37 defaultConfig { - applicationId = "com.httpsms" + applicationId = "com.coremaster.httpsms" minSdk = 28 targetSdk = 37 versionCode = 1 diff --git a/android/app/google-services.json b/android/app/google-services.json index 4db4c0640..5e5875885 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -9,7 +9,7 @@ "client_info": { "mobilesdk_app_id": "1:877524083399:android:5ceb08a909fd24a96514e2", "android_client_info": { - "package_name": "com.httpsms" + "package_name": "com.coremaster.httpsms" } }, "oauth_client": [ @@ -17,7 +17,7 @@ "client_id": "877524083399-londfmd80qqlb2gebpbhctavlmqtla3b.apps.googleusercontent.com", "client_type": 1, "android_info": { - "package_name": "com.httpsms", + "package_name": "com.coremaster.httpsms", "certificate_hash": "58df9f7489b8bb5e3cd57f01a03d5e0068d8c185" } }, diff --git a/api/pkg/di/container.go b/api/pkg/di/container.go index ad9a18858..c05c94038 100644 --- a/api/pkg/di/container.go +++ b/api/pkg/di/container.go @@ -1793,6 +1793,10 @@ func (container *Container) UserRistrettoCache() *ristretto.Cache[string, entiti // InitializeTraceProvider initializes the open telemetry trace provider func (container *Container) InitializeTraceProvider() func() { + if isLocal() { + container.logger.Debug("skipping axiom trace provider (ENV=local)") + return func() {} + } return container.initializeAxiomTraceProvider(container.version, container.projectID) } diff --git a/docker-compose.yml b/docker-compose.yml index ef63287d2..861a36f7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,52 +1,82 @@ services: postgres: - image: postgres:alpine + image: postgres:16-alpine environment: POSTGRES_DB: httpsms POSTGRES_PASSWORD: dbpassword POSTGRES_USER: dbusername volumes: - postgres:/var/lib/postgresql/data - ports: - - "5435:5432" - restart: on-failure + # Solo red interna del compose (Dokploy no necesita publicar 5432) + expose: + - "5432" + restart: unless-stopped + # Healthcheck más agresivo: el intervalo 30s + start_period 5s fallaba el deploy healthcheck: - test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] - interval: 30s - timeout: 60s - retries: 5 - start_period: 5s + test: ["CMD-SHELL", "pg_isready -U dbusername -d httpsms"] + interval: 5s + timeout: 5s + retries: 20 + start_period: 20s redis: - image: redis:latest - command: redis-server + image: redis:7-alpine + command: redis-server --appendonly yes volumes: - - redis:/var/lib/redis - ports: - - "6379:6379" - restart: on-failure + - redis:/data + expose: + - "6379" + restart: unless-stopped + healthcheck: + test: ["CMD", "redis-cli", "ping"] + interval: 5s + timeout: 3s + retries: 10 api: build: context: ./api - ports: - - "8000:8000" + # Dokploy: Environment del compose → .env en la raíz del proyecto + env_file: + - .env + # Sin bind al host: Dokploy/Traefik enruta al puerto interno + expose: + - "8000" depends_on: postgres: condition: service_healthy redis: condition: service_started - env_file: - - ./api/.env + restart: unless-stopped web: build: context: ./web - ports: - - "3000:3000" + args: + API_BASE_URL: ${API_BASE_URL} + APP_URL: ${APP_URL} + APP_NAME: ${APP_NAME:-httpSMS} + APP_GITHUB_URL: ${APP_GITHUB_URL:-https://github.com/NdoleStudio/httpsms} + APP_DOCUMENTATION_URL: ${APP_DOCUMENTATION_URL:-https://docs.httpsms.com} + APP_DOWNLOAD_URL: ${APP_DOWNLOAD_URL:-} + APP_ENV: ${APP_ENV:-production} + CLOUDFLARE_TURNSTILE_SITE_KEY: ${CLOUDFLARE_TURNSTILE_SITE_KEY:-} + PUSHER_KEY: ${PUSHER_KEY:-} + PUSHER_CLUSTER: ${PUSHER_CLUSTER:-} + FIREBASE_API_KEY: ${FIREBASE_API_KEY} + FIREBASE_AUTH_DOMAIN: ${FIREBASE_AUTH_DOMAIN} + FIREBASE_PROJECT_ID: ${FIREBASE_PROJECT_ID} + FIREBASE_STORAGE_BUCKET: ${FIREBASE_STORAGE_BUCKET} + FIREBASE_MESSAGING_SENDER_ID: ${FIREBASE_MESSAGING_SENDER_ID} + FIREBASE_APP_ID: ${FIREBASE_APP_ID} + FIREBASE_MEASUREMENT_ID: ${FIREBASE_MEASUREMENT_ID:-} + # 3000 del host ya estaba ocupado; Dokploy usa el puerto interno del contenedor + expose: + - "3000" depends_on: api: condition: service_started + restart: unless-stopped volumes: redis: diff --git a/web/Dockerfile b/web/Dockerfile index f283fd32a..743682493 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -3,21 +3,64 @@ FROM node:22-alpine AS build WORKDIR /app -COPY package.json pnpm-lock.yaml ./ +# Inyectadas desde docker-compose build.args ← Environment de Dokploy (.env raíz) +ARG API_BASE_URL +ARG APP_URL +ARG APP_NAME +ARG APP_GITHUB_URL +ARG APP_DOCUMENTATION_URL +ARG APP_DOWNLOAD_URL +ARG APP_ENV +ARG CLOUDFLARE_TURNSTILE_SITE_KEY +ARG PUSHER_KEY +ARG PUSHER_CLUSTER +ARG FIREBASE_API_KEY +ARG FIREBASE_AUTH_DOMAIN +ARG FIREBASE_PROJECT_ID +ARG FIREBASE_STORAGE_BUCKET +ARG FIREBASE_MESSAGING_SENDER_ID +ARG FIREBASE_APP_ID +ARG FIREBASE_MEASUREMENT_ID -# Install pnpm -RUN npm install -g pnpm +ENV API_BASE_URL=$API_BASE_URL \ + APP_URL=$APP_URL \ + APP_NAME=$APP_NAME \ + APP_GITHUB_URL=$APP_GITHUB_URL \ + APP_DOCUMENTATION_URL=$APP_DOCUMENTATION_URL \ + APP_DOWNLOAD_URL=$APP_DOWNLOAD_URL \ + APP_ENV=$APP_ENV \ + CLOUDFLARE_TURNSTILE_SITE_KEY=$CLOUDFLARE_TURNSTILE_SITE_KEY \ + PUSHER_KEY=$PUSHER_KEY \ + PUSHER_CLUSTER=$PUSHER_CLUSTER \ + FIREBASE_API_KEY=$FIREBASE_API_KEY \ + FIREBASE_AUTH_DOMAIN=$FIREBASE_AUTH_DOMAIN \ + FIREBASE_PROJECT_ID=$FIREBASE_PROJECT_ID \ + FIREBASE_STORAGE_BUCKET=$FIREBASE_STORAGE_BUCKET \ + FIREBASE_MESSAGING_SENDER_ID=$FIREBASE_MESSAGING_SENDER_ID \ + FIREBASE_APP_ID=$FIREBASE_APP_ID \ + FIREBASE_MEASUREMENT_ID=$FIREBASE_MEASUREMENT_ID -RUN pnpm install +# allowBuilds vive en pnpm-workspace.yaml (pnpm 10); hay que copiarlo ANTES del install +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ + +RUN npm install -g pnpm@10 + +# Docker: no hay .git → husky no debe instalar hooks +ENV HUSKY=0 \ + CI=true + +RUN pnpm install --no-frozen-lockfile COPY . . +ENV HUSKY=0 \ + CI=true + RUN pnpm run generate # production stage FROM nginx:stable-alpine AS production COPY --from=build /app/.output/public /usr/share/nginx/html -# Copy the nginx configuration file COPY ./nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 3000