Skip to content

Instantly share code, notes, and snippets.

@kudaliar032
Created October 3, 2021 05:30
Show Gist options
  • Save kudaliar032/4e21a0c36f1988e40f383067dddb2817 to your computer and use it in GitHub Desktop.
Save kudaliar032/4e21a0c36f1988e40f383067dddb2817 to your computer and use it in GitHub Desktop.
day2.txt
## multi stage
mkdir ~/latihan-multi-stage
cd ~/latihan-multi-stage
git clone https://github.com/kudaliar032/comfortable-vue-blog.git
cd comfortable-vue-blog
vim Dockerfile
```docker
FROM node:14 AS builder
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY . .
RUN npm run build
FROM nginx:alpine AS runtime
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
```
docker build -t nodejs:multi-stage .
docker images
docker run -d -p 8080:80 nodejs:multi-stage
curl localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment