add configuration to use react-express-mysql sample with Docker Dev Environments feature (#270)

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
This commit is contained in:
Guillaume Lours
2022-07-13 10:35:12 +02:00
committed by GitHub
parent 74317904bd
commit e45810975f
6 changed files with 111 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
# syntax=docker/dockerfile:1.4
# if you're doing anything beyond your local machine, please pin this to a specific version at https://hub.docker.com/_/node/
FROM node:lts
FROM node:lts AS development
# set our node environment, either development or production
# defaults to production, compose overrides this to development on build and run
@@ -29,3 +31,17 @@ COPY . /code
# using node here is still more graceful stopping then npm with --init afaik
# I still can't come up with a good production way to run with npm and graceful shutdown
CMD [ "node", "src/index.js" ]
FROM development as dev-envs
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends git
EOF
RUN <<EOF
useradd -s /bin/bash -m vscode
groupadd docker
usermod -aG docker vscode
EOF
# install Docker tools (cli, buildx, compose)
COPY --from=gloursdocker/docker / /