Skip to content

ValterAndrei/start_project_vue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 

Repository files navigation

Starting a new Vue project using docker-compose

  1. Create files
touch Dockerfile docker-compose.yml .dockerignore
  • Dockerfile
FROM node:20-alpine3.19
RUN npm install -g @vue/cli
RUN mkdir /app
WORKDIR /app
COPY . /app
RUN yarn install
EXPOSE 8080
CMD ['yarn', 'serve']
  • docker-compose.yml
services:
  app:
    build: .
    container_name: vue_app_container
    ports:
      - '8080:8080'
    volumes:
      - ./:/app
    command: yarn serve
  • .dockerignore
node_modules
.git
.gitignore
  1. Access the container
docker-compose run --rm app sh
  1. Create the project
vue create .
  1. Changing file permission
sudo chown -R $USER:$USER .
  1. Up server
docker-compose up app

localhost:8080


If your project already exists:

  1. Buid image from Dockerfile
docker-compose build
  1. Up server
docker-compose up app

Only Docker example

Deploying at Heroku

Vue references

About

Starting a new Vue project using docker and docker-compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors