Created
October 3, 2021 05:30
-
-
Save kudaliar032/4e21a0c36f1988e40f383067dddb2817 to your computer and use it in GitHub Desktop.
day2.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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