web
This commit is contained in:
@@ -44,9 +44,10 @@ RUN apk add --no-cache \
|
|||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
||||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
||||||
|
|
||||||
# Create non-root user
|
RUN groupadd -r whatsapp && useradd -r -g whatsapp whatsapp
|
||||||
RUN addgroup -g 1000 whatsapp && \
|
#DEV Create non-root user
|
||||||
adduser -D -u 1000 -G whatsapp whatsapp
|
#RUN addgroup -S whatsapp || true && \
|
||||||
|
# adduser -D -S -G whatsapp whatsapp || true
|
||||||
|
|
||||||
# Copy dependencies from builder
|
# Copy dependencies from builder
|
||||||
COPY --from=builder --chown=whatsapp:whatsapp /app/node_modules ./node_modules
|
COPY --from=builder --chown=whatsapp:whatsapp /app/node_modules ./node_modules
|
||||||
|
|||||||
74
dev-docker-compose.yml
Normal file
74
dev-docker-compose.yml
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
services:
|
||||||
|
wapp:
|
||||||
|
#user: "1000:1000"
|
||||||
|
build:
|
||||||
|
#context: /opt/apps/wapp
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "3001:3001"
|
||||||
|
container_name: wapp
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- traefik_net
|
||||||
|
environment:
|
||||||
|
# Server configuration
|
||||||
|
- PORT=3001
|
||||||
|
- NODE_ENV=production
|
||||||
|
|
||||||
|
# API Security
|
||||||
|
- API_KEY=${API_KEY:-your-secure-api-key-here}
|
||||||
|
|
||||||
|
# Paths (pointing to volume mounts)
|
||||||
|
- DB_PATH=/app/data/whatsapp.db
|
||||||
|
- MEDIA_PATH=/app/media
|
||||||
|
|
||||||
|
# WhatsApp configuration
|
||||||
|
# Set HEADLESS=false to see the browser window (useful for debugging)
|
||||||
|
- HEADLESS=true
|
||||||
|
- REJECT_CALLS=false
|
||||||
|
|
||||||
|
# WebSocket URL for QR page (set this to your public URL when using Traefik - )
|
||||||
|
# Example: - WS_URL=https://wapp.appmodel.nl
|
||||||
|
- WS_URL=https://wapp.appmodel.nl
|
||||||
|
|
||||||
|
# CORS configuration
|
||||||
|
- CORS_ORIGIN=*
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# Persistent data volumes
|
||||||
|
- whatsapp-data:/app/data
|
||||||
|
- whatsapp-media:/app/media
|
||||||
|
- whatsapp-cache:/app/.wwebjs_cache
|
||||||
|
- whatsapp-auth:/app/.wwebjs_auth
|
||||||
|
|
||||||
|
# Uncomment labels below when ready to use Traefik
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.wapp.rule=Host(`wapp.appmodel.nl`)"
|
||||||
|
- "traefik.http.routers.wapp.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.wapp.tls=true"
|
||||||
|
- "traefik.http.routers.wapp.tls.certresolver=letsencrypt"
|
||||||
|
- "traefik.http.services.wapp.loadbalancer.server.port=3001"
|
||||||
|
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik_net:
|
||||||
|
external: true
|
||||||
|
name: traefik_net
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
whatsapp-data:
|
||||||
|
driver: local
|
||||||
|
whatsapp-media:
|
||||||
|
driver: local
|
||||||
|
whatsapp-cache:
|
||||||
|
driver: local
|
||||||
|
whatsapp-auth:
|
||||||
|
driver: local
|
||||||
@@ -4,6 +4,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: /opt/apps/wapp
|
context: /opt/apps/wapp
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "3001:3001"
|
||||||
container_name: wapp
|
container_name: wapp
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user