Sign inSign up

asobchenyuk/nuxt-app

By asobchenyuk

Updated almost 2 years ago

nuxt

Image
Web servers
0

305

asobchenyuk/nuxt-app repository overview

Nuxt 3 Application

This repository contains a Nuxt 3 application that is containerized using Docker and can be deployed using Docker Compose.

Features

  • Uses Nuxt 3 for the frontend
  • Configured to work with WebSockets
  • Containerized using Docker
  • Can be easily deployed using Docker Compose

Environment Variables

The application uses the following environment variables which should be defined in a .env file:

  • NUXT_PUBLIC_WEBSOCKET_URL: URL for the WebSocket server
  • PORT: Port on which the application will run

Usage

Build and Run with Docker Compose
  1. Clone the repository:

    git clone https://github.com/yourusername/nuxt-app.git
    cd nuxt-app
    
  2. Create a .env file and populate it with your environment variables:

    NUXT_PUBLIC_WEBSOCKET_URL=ws://localhost:3001
    PORT=3005
    
  3. Build the Docker image and start the container:

    docker-compose up --build
    
  4. Access the application: Open your browser and navigate to http://localhost:3005.

Build and Push to Docker Hub
  1. Build the Docker image:

    docker build -t yourusername/nuxt-app:latest .
    
  2. Login to Docker Hub:

    docker login
    
  3. Push the Docker image to Docker Hub:

    docker push yourusername/nuxt-app:latest
    
Running Locally
  1. Install dependencies:

    npm install
    
  2. Run the development server:

    npm run dev
    
  3. Access the application: Open your browser and navigate to http://localhost:3005.

Docker Compose

To use Docker Compose for local development and testing, follow these steps:

  1. Create a docker-compose.yml file in the root of your project:

    version: '3.3'
    services:
      nuxt-app:
        build:
          context: .
          dockerfile: Dockerfile
        container_name: mhp-nuxt
        restart: unless-stopped
        ports:
          - "${PORT}:${PORT}"
        environment:
          - NUXT_PUBLIC_WEBSOCKET_URL=${NUXT_PUBLIC_WEBSOCKET_URL}
        env_file:
          - .env
    
  2. Create a .env file in the root of your project:

    NUXT_PUBLIC_WEBSOCKET_URL=ws://localhost:3001
    PORT=3005
    
  3. Run Docker Compose:

    docker-compose up
    
  4. Stop Docker Compose:

    docker-compose down
    

License

This project is licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:ae12dfcf6

Size

522.8 MB

Last updated

almost 2 years ago

docker pull asobchenyuk/nuxt-app