diff --git a/code/websites/pokedex.online/server/Dockerfile b/code/websites/pokedex.online/server/Dockerfile new file mode 100644 index 0000000..8e5e8cd --- /dev/null +++ b/code/websites/pokedex.online/server/Dockerfile @@ -0,0 +1,31 @@ +# Backend Production Dockerfile +FROM node:20-alpine + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install production dependencies only +RUN npm ci --only=production + +# Copy application code +COPY . . + +# Create directories for data and logs +RUN mkdir -p /app/data /app/logs + +# Set production environment +ENV NODE_ENV=production +ENV PORT=3000 + +# Expose the server port +EXPOSE 3000 + +# Health check endpoint (will be added to server) +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD node -e "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" + +# Run the application +CMD ["node", "oauth-proxy.js"]