awesome-compose/vuejs
Madhu Kumar f06d93bd78
Update Dockerfile
Changes included in this PR
vuejs/vuejs/Dockerfile
We recommend upgrading to node:14.18.2-alpine, as this image has only 0 known vulnerabilities. To do this, merge this pull request, then verify your application still works as expected.

Some of the most important vulnerabilities in your base image include:

Severity	Priority Score / 1000	Issue	Exploit Maturity
critical severity	500	Out-of-bounds Read
SNYK-ALPINE311-APKTOOLS-1534687	No Known Exploit
high severity	400	Improper Certificate Validation
SNYK-ALPINE311-OPENSSL-1089242	No Known Exploit
high severity	400	Out-of-bounds Read
SNYK-ALPINE311-OPENSSL-1569447	No Known Exploit
critical severity	500	Buffer Overflow
SNYK-ALPINE311-OPENSSL-1569451	No Known Exploit
critical severity	500	Buffer Overflow
SNYK-ALPINE311-OPENSSL-1569451	No Known Exploit
2022-02-19 22:21:07 +01:00
..
vuejs Update Dockerfile 2022-02-19 22:21:07 +01:00
docker-compose.yaml Remove version from compose files to conform to the specification (#167) 2021-11-04 15:51:58 +01:00
output.jpg Move all samples to the root dir 2020-03-16 17:23:59 +01:00
README.md fixed service name in description (#178) 2021-11-15 21:27:40 +01:00

Compose sample application

VueJS

Project structure:

.
├── docker-compose.yaml
├── README.md
└── vuejs
    ├── Dockerfile
    └── ...

docker-compose.yaml

services:
  web:
    build: vuejs
    ports:
    - 80:8080
    volumes:
    - ./vuejs:/project
    - /project/node_modules

The compose file defines an application with one service vuejs. When deploying the application, docker-compose maps port 8080 of the web service container to port 8080 of the host as specified in the file. Make sure port 8080 on the host is not already being in use.

Deploy with docker-compose

$ docker-compose up -d
Creating network "vuejs_default" with the default driver
Building web
Step 1/8 : FROM node:13.10.1-alpine
...
Successfully tagged vuejs_web:latest
WARNING: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating vuejs_web_1 ... done

Expected result

Listing containers must show one container running and the port mapping as below:

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                  NAMES
701c02bb97b1        vuejs_web           "docker-entrypoint.s…"   49 seconds ago      Up 46 seconds       0.0.0.0:80->8080/tcp   vuejs_web_1

After the application starts, navigate to http://localhost:80 in your web browser.

page

Stop and remove the containers

$ docker-compose down
Stopping vuejs_web_1 ... done
Removing vuejs_web_1 ... done
Removing network vuejs_default