mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-26 10:43:35 +02:00
react-express-mongodb: clean frontend code
- apply prettier style on every js file - remove mutation on immutable variables - remove wrapper on top of axios - fix form handling - remove useless port definition in dockerfile Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
This commit is contained in:
parent
be7f09b6ba
commit
e5828ad1bf
10 changed files with 120 additions and 151 deletions
|
@ -1,27 +1,14 @@
|
|||
FROM node:13.13.0-stretch-slim
|
||||
|
||||
#Argument that is passed from docer-compose.yaml file
|
||||
ARG NODE_PORT
|
||||
|
||||
#Echo the argument to check passed argument loaded here correctly
|
||||
RUN echo "Argument port is : $NODE_PORT"
|
||||
FROM node:lts-buster-slim
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
#COPY . .
|
||||
COPY . .
|
||||
COPY package.json /usr/src/app/package.json
|
||||
COPY package-lock.json /usr/src/app/package-lock.json
|
||||
RUN npm ci
|
||||
|
||||
# Install app dependencies
|
||||
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
||||
# where available (npm@5+)
|
||||
RUN npm install
|
||||
|
||||
|
||||
#In my case my app binds to port NODE_PORT so you'll use the EXPOSE instruction to have it mapped by the docker daemon:
|
||||
|
||||
EXPOSE ${NODE_PORT}
|
||||
|
||||
CMD npm run dev
|
||||
COPY . /usr/src/app
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD [ "npm", "run", "dev" ]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue