mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
nginx-nodejs-redis: add dev envs config
* Add Docker Desktop Development Environments config * Upgrade NodeJS image * Rename `nginx` to `proxy` and use bind mount for config for consistency with other examples Signed-off-by: Milas Bowman <milas.bowman@docker.com>
This commit is contained in:
parent
9d547d23fb
commit
a6048a745a
7 changed files with 182 additions and 66 deletions
|
@ -1,9 +1,31 @@
|
|||
FROM node:14.17.3-alpine3.14
|
||||
# syntax=docker/dockerfile:1.4
|
||||
FROM --platform=$BUILDPLATFORM node:18-alpine AS builder
|
||||
|
||||
ENV NPM_CONFIG_CACHE /npm-cache
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
RUN --mount=type=cache,target=/npm-cache \
|
||||
npm ci
|
||||
|
||||
COPY ./server.js ./
|
||||
|
||||
CMD ["npm","start"]
|
||||
CMD ["npm", "start"]
|
||||
|
||||
FROM builder as dev-envs
|
||||
|
||||
RUN <<EOF
|
||||
apk update
|
||||
apk add git
|
||||
EOF
|
||||
|
||||
RUN <<EOF
|
||||
addgroup -S docker
|
||||
adduser -S --shell /bin/bash --ingroup docker vscode
|
||||
EOF
|
||||
|
||||
# install Docker tools (cli, buildx, compose)
|
||||
COPY --from=gloursdocker/docker / /
|
||||
|
||||
CMD ["npm", "start"]
|
||||
|
|
|
@ -13,7 +13,7 @@ app.get('/', function(req, res) {
|
|||
if (isNaN(numVisitsToDisplay)) {
|
||||
numVisitsToDisplay = 1;
|
||||
}
|
||||
res.send(os.hostname() +': Number of visits is: ' + numVisitsToDisplay);
|
||||
res.send(os.hostname() +': Number of visits is: ' + numVisitsToDisplay + '!!!\n');
|
||||
numVisits++;
|
||||
redisClient.set('numVisits', numVisits);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue