Date : 09-12-2024 00:38 Status : IMPLEMENTEE Service : hellocar:api Environnement : PROD
| Élément | Valeur |
|---|---|
| Type | Monorepo pnpm |
| Framework API | Elysia (Bun) |
| Dépendance workspace | @hellocar/common |
| Shortcut | bun |
| Port | 4510 |
| Domaine | hellocar-api-prod.33800.nowhere84.com |
| Variable | Valeur |
|---|---|
| NODE_ENV | production |
| API_PORT | 4510 |
| API_HOST | 0.0.0.0 |
| SUPABASE_URL | https://hellocar-api.33800.nowhere84.com |
| SUPABASE_SERVICE_ROLE_KEY | eyJhbGci... (présent dans prod.env) |
| TZ | Europe/Paris |
cd /tmp/hellocar && pnpm install && pnpm --filter @hellocar/common build
Création d'un Dockerfile adapté au monorepo :
FROM oven/bun:latest
WORKDIR /app
# Installer pnpm
RUN npm install -g pnpm
# Copier les fichiers workspace
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY packages/common/package.json ./packages/common/
COPY apps/api/package.json ./apps/api/
# Installer les dépendances
RUN pnpm install --frozen-lockfile
# Copier le code source
COPY packages/common ./packages/common
COPY apps/api ./apps/api
# Build common puis API
RUN pnpm --filter @hellocar/common build
RUN pnpm --filter @hellocar/api build
WORKDIR /app/apps/api
EXPOSE 4510
CMD ["bun", "dist/index.js"]
docker build -t hellocar-api:prod .
docker run -d \
--name hellocar-api-prod \
--restart unless-stopped \
-p 4510:4510 \
-e NODE_ENV=production \
-e API_PORT=4510 \
-e API_HOST=0.0.0.0 \
-e SUPABASE_URL=... \
-e SUPABASE_SERVICE_ROLE_KEY=... \
-e TZ=Europe/Paris \
hellocar-api:prod
hellocar-api-prod actif sur le port 4510http://192.168.1.11:4510https://hellocar-api-prod.33800.nowhere84.comConfirmes-tu le déploiement ? (oui/non)