feat: Add Docker support with production and development configurations for backend and frontend

This commit is contained in:
MayaTheShy
2026-02-16 00:08:49 -05:00
parent a6edc0934c
commit 30647fca50
9 changed files with 580 additions and 1 deletions

23
server/Dockerfile Normal file
View File

@@ -0,0 +1,23 @@
# Node.js backend
FROM node:18-alpine
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy server code
COPY server.js ./
# Expose ports
EXPOSE 3001 3002
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3001/api/turtles', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start server
CMD ["node", "server.js"]