diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..f877c227 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +/node_modules +/Dockerfile +/docker-compose.yml +/dist diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..54551728 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:24-alpine + +RUN apk update + +RUN apk upgrade + +RUN apk add jq xdg-utils + +WORKDIR /app + +COPY . . + +RUN sed -i -e 's/vite --force/vite --force --host/' package.json + +RUN npm install + +RUN npm run build:azure || true + +EXPOSE 5173 + +CMD [ "npm", "run", "dev" ] diff --git a/README.md b/README.md index 173858df..f0db7180 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,47 @@ Run with the `--watch` flag (`npm test -- --watch`) to run in interactive watch This project is tested with [BrowserStack](https://www.browserstack.com/). +## Running with Docker Compose + +To run the VIA web application using `docker compose`, follow these steps: + +1. **Prerequisites** + - [Docker](https://docs.docker.com/get-docker/) installed + - [Docker Compose](https://docs.docker.com/compose/install/) installed + +2. **Start the application** + ```bash + docker compose up + ``` + +3. **Access the application** + Open your browser and navigate to [http://localhost:5173](http://localhost:5173) + +4. **Stop the application** + ```bash + docker compose down + ``` + +### Docker Compose Configuration + +The Docker Compose setup includes: +- Node.js 24 Alpine base image +- Vite development server with host binding +- Port mapping for local development (localhost:5173) +- Automatic restart policy (`unless-stopped`) +- Optimized build process for development environment + +### Building from Source + +If you need to rebuild the container after making changes: +```bash +docker compose build --no-cache +docker compose up +``` + +This approach ensures a consistent environment and eliminates dependency issues +during local development. + ## Looking for an offline app? @cebby2420 has kindly made a desktop app that does so. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..4e2d43a8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +# Run `docker-compose up` to build and run the via app in docker +services: + via: + build: + context: . + pull: true + dockerfile: Dockerfile + tags: + - via + restart: unless-stopped + stdin_open: true + tty: true + ports: + - "127.0.0.1:5173:5173" + depends_on: []