dev-resources.site
for different kinds of informations.
Vue 2 vite dockerized steps
Published at
11/11/2023
Categories
vue
docker
dockercompose
vite
Author
shaikhalamin
Author
12 person written this
shaikhalamin
open
*Create the Dockerfile like below : *
FROM node:lts-alpine
WORKDIR /usr/src/app
COPY package*.json package-lock.json ./
COPY vite.config.js ./
RUN npm install
COPY . .
EXPOSE 7890
EXPOSE 3010
Now modify the docker-compose like the below:
frontend-service:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend-container
command: npm run dev
depends_on:
- backend-service
ports:
- 7890:5173
- 3010:3010
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
networks:
- your-network
Now update the vite.config.js file like below:
N:B: For the server config hmr host and port is very important
export default defineConfig({
[.....rest of the config here]
server: {
host: true,
hmr: {
host: "0.0.0.0",
port: 3010,
},
},
});
dockercompose Article's
30 articles in total
Want to Learn Docker in Advance Way?
read article
deploy Jenkins using docker compose with production ready
read article
Docker Advance Part 2: Docker Logging
read article
A Simple Guide to Docker Compose & Multi-Container Applications
read article
Dockerize nestjs app with postgres
read article
Tips and Tricks for Docker Compose: Leveraging the override Feature
read article
Dockerize nestjs application with Postgres
read article
RabbitMQ container with Docker Compose
read article
Quick and simple Local WordPress Setup for Lazy Developers
read article
Bug: Docker-compose up?
read article
How to resolve Docker Compose Warning WARN[0000] Found orphan containers
read article
How to resolve Docker Compose Warning WARN[0000] Found orphan containers
read article
How To Set Up Docker SeleniumΒ GRID
read article
How to Ensure Docker Compose Uses Environment Variables from the `.env` File
read article
Essential Docker Commands for Developers
read article
[Docker] How to fix 'host not found in upstream "host.docker.internal"'.
read article
Como configurar imagem Docker(PHP e Nginx) para projetos Laravel com PHP 8.3
read article
Containerize your multi-services app with docker compose
read article
αααααΆαααα»αα’αααΈαααΆαα α’αα αααα»α Docker compose.
read article
Installation of Docker Compose:
read article
MongoDB containers with Docker Compose
read article
An Overview of Docker Compose and its Features.
read article
How to change docker root data directory and why would you want to do that (hint: to optimize space)
read article
Containerize a Web Application using docker compose
read article
O Docker Compose agora tem uma V2, veja como instalar
read article
Vue 2 vite dockerized steps
currently reading
An Advanced Guide (2) to Docker: Managing Multi-Container Applications π³
read article
How to run mongodb using docker-compose in ubuntu
read article
How to run postgres database using docker and docker-compose
read article
Easy Dockerization with Docker INIT
read article
Featured ones: