File tree Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Expand file tree Collapse file tree 4 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 1+ services :
2+ web :
3+ build :
4+ context : vuejs
5+ target : dev-envs
6+ ports :
7+ - 8080:8080
8+ volumes :
9+ - /var/run/docker.sock:/var/run/docker.sock
Original file line number Diff line number Diff line change @@ -59,3 +59,11 @@ Stopping vuejs_web_1 ... done
5959Removing vuejs_web_1 ... done
6060Removing network vuejs_default
6161```
62+
63+ ## Use with Docker Development Environments
64+
65+ You can use this sample with the Dev Environments feature of Docker Desktop.
66+ To develop directly web service inside containers, you just need to use the https git url of the sample:
67+ ` https://github.com/docker/awesome-compose/tree/master/vuejs `
68+
69+ ![ page] ( ../dev-envs.png )
Original file line number Diff line number Diff line change 11services :
22 web :
3- build : vuejs
3+ build :
4+ context : vuejs
5+ target : development
46 ports :
57 - 8080:8080
68 volumes :
Original file line number Diff line number Diff line change 1- FROM node:14.4.0-alpine
1+ # syntax=docker/dockerfile:1.4
2+ FROM --platform=$BUILDPLATFORM node:14.4.0-alpine AS development
23
34RUN mkdir /project
45WORKDIR /project
@@ -9,3 +10,18 @@ RUN yarn global add @vue/cli
910RUN yarn install
1011ENV HOST=0.0.0.0
1112CMD ["yarn" , "run" , "serve" ]
13+
14+ FROM development as dev-envs
15+ RUN <<EOF
16+ apk update
17+ apk add git
18+ EOF
19+
20+ RUN <<EOF
21+ addgroup -S docker
22+ adduser -S --shell /bin/bash --ingroup docker vscode
23+ EOF
24+ # install Docker tools (cli, buildx, compose)
25+ COPY --from=gloursdocker/docker / /
26+ CMD ["yarn" , "run" , "serve" ]
27+
You can’t perform that action at this time.
0 commit comments