Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ POSTGRES_DB_URL_FLIGHTS=postgresql://
POSTGRES_DB_URL_CHATS=postgresql://
POSTGRES_DB_PW=
DB_ENCRYPTION_KEY=
REDIS_URL=redis://

DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
Expand Down
6 changes: 3 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5"
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# filepath: c:\Users\rcxga\OneDrive\Desktop\CODE\PFConnect\pfcontrol-2\Dockerfile
# Multi-stage build for PFControl v2
FROM node:20-alpine AS builder

Expand All @@ -16,7 +17,10 @@ COPY . .
# Copy frontend env for Vite build
COPY .env.vite.production .env.production

# Build the application
# Build the backend (TypeScript compilation)
RUN npm run build:server

# Build the application (frontend)
RUN npm run build

# Production stage
Expand All @@ -27,7 +31,7 @@ RUN apk add --no-cache dumb-init

# Create app user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodeuser -u 1001
adduser -S nodeuser -u 1001

# Set working directory
WORKDIR /app
Expand All @@ -41,7 +45,7 @@ RUN npm ci --omit=dev && npm cache clean --force
# Copy built application from builder stage
COPY --from=builder --chown=nodeuser:nodejs /app/dist ./dist
COPY --from=builder --chown=nodeuser:nodejs /app/public ./public
COPY --from=builder --chown=nodeuser:nodejs /app/server ./server
COPY --from=builder --chown=nodeuser:nodejs /app/server/dist ./server/dist

# Create logs directory
RUN mkdir -p logs && chown nodeuser:nodejs logs
Expand All @@ -54,8 +58,8 @@ EXPOSE 9900

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:9900/api/data/airports', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"
CMD node -e "require('http').get('http://localhost:9900/api/data/airports', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) }).on('error', () => process.exit(1))"

# Start the application
ENTRYPOINT ["dumb-init", "--"]
CMD ["node", "server/server.js"]
CMD ["node", "server/dist/main.js"]
5 changes: 5 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"watch": ["server"],
"ext": "ts,json",
"exec": "tsx server/main.ts"
}
Loading