This repository contains a Nuxt 3 application that is containerized using Docker and can be deployed using Docker Compose.
The application uses the following environment variables which should be defined in a .env file:
NUXT_PUBLIC_WEBSOCKET_URL: URL for the WebSocket serverPORT: Port on which the application will runClone the repository:
git clone https://github.com/yourusername/nuxt-app.git
cd nuxt-app
Create a .env file and populate it with your environment variables:
NUXT_PUBLIC_WEBSOCKET_URL=ws://localhost:3001
PORT=3005
Build the Docker image and start the container:
docker-compose up --build
Access the application:
Open your browser and navigate to http://localhost:3005.
Build the Docker image:
docker build -t yourusername/nuxt-app:latest .
Login to Docker Hub:
docker login
Push the Docker image to Docker Hub:
docker push yourusername/nuxt-app:latest
Install dependencies:
npm install
Run the development server:
npm run dev
Access the application:
Open your browser and navigate to http://localhost:3005.
To use Docker Compose for local development and testing, follow these steps:
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
Create a .env file in the root of your project:
NUXT_PUBLIC_WEBSOCKET_URL=ws://localhost:3001
PORT=3005
Run Docker Compose:
docker-compose up
Stop Docker Compose:
docker-compose down
This project is licensed under the MIT License.
Content type
Image
Digest
sha256:ae12dfcf6…
Size
522.8 MB
Last updated
almost 2 years ago
docker pull asobchenyuk/nuxt-app