Skip to content

Instantly share code, notes, and snippets.

@arellano-gustavo
Created May 23, 2021 16:40
Show Gist options
  • Save arellano-gustavo/cc1a0bfa9b60850f5c600e8d12d2a103 to your computer and use it in GitHub Desktop.
Save arellano-gustavo/cc1a0bfa9b60850f5c600e8d12d2a103 to your computer and use it in GitHub Desktop.
Dockerfile for a VueJS clean environment
FROM ubuntu
RUN apt-get update
RUN apt-get -y install sudo
RUN apt-get -y install curl
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g @vue/cli
RUN useradd -m ejemplo && echo "ejemplo:ejemplo" | chpasswd && adduser ejemplo sudo
RUN gpasswd -a ejemplo sudo
RUN su -l ejemplo
USER ejemplo
CMD /bin/bash
@arellano-gustavo
Copy link
Author

arellano-gustavo commented May 23, 2021

For some reason, when I run this dockerfile in my local personal computer, I get errors when installing cURL
In my cloud (AWS) it run perfect.
After creating an image: docker build . -t ejemplo
We can run the container like this: docker run -it ejemplo
Once we are inside, we can create a directory, move into that directory and execute:
vue create prueba
Some questions will be asked and after that, we can run:
npm run serve
Voila !!!!! Everything is done !!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment