-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 966 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# YetAnotherAA Docker All-in-One
FROM node:20.19.0-alpine
WORKDIR /app
# Install PM2 globally
RUN npm install -g pm2 && apk add --no-cache git
# Copy package files
COPY package*.json ./
COPY aastar/package*.json ./aastar/
COPY aastar-frontend/package*.json ./aastar-frontend/
# Install dependencies with force flag to bypass platform-specific issues
RUN npm ci --include=dev --force
# Copy source code
COPY . .
# Build all applications
ENV NEXT_PUBLIC_API_URL=/api/v1
ENV BACKEND_API_URL=http://localhost:3000
ENV NEXT_BUILD_STANDALONE=true
RUN npm run build -w aastar && \
npm run build -w aastar-frontend
# The configuration files are already copied with 'COPY . .' above
# Expose port for frontend
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
# Start all services with PM2
CMD ["pm2-runtime", "start", "ecosystem.config.js"]