Skip to content

Conversation

MitchellArtz
Copy link

Overview

This PR adds Docker and Docker Compose support to enable containerized deployment of the application. The setup includes a multi-stage build process for optimal image size and a production-grade Nginx configuration that properly handles Vue Router history mode.

Changes

  • Added Dockerfile with multi-stage build:
    • Build stage using node:16-alpine for minimal size
    • Production stage using nginx:stable-alpine to serve static files
  • Added docker-compose.yml for orchestration
  • Added custom nginx.conf with proper configuration for Vue Router
  • Configured proper handling of SPA routes to prevent 404 errors

Benefits

  • Simplified deployment process
  • Consistent environment across different platforms
  • Production-optimized Nginx configuration
  • Reduced image size through multi-stage builds
  • Proper handling of client-side routing

Testing

  • Verified local development using docker-compose up --build
  • Confirmed routing works correctly, including the login page
  • Tested static asset serving
  • Verified Nginx configuration handles all routes properly

How to Test

  1. Clone the repository
  2. Run docker compose up --build
  3. Navigate to http://localhost

Notes

  • The application runs on port 80 by default
  • Environment variables can be configured through docker-compose.yml
  • Development mode can still be run traditionally using npm run serve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant