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:
committed by
Guillaume Lours
parent
be7f09b6ba
commit
e5828ad1bf
1
react-express-mongodb/backend/.dockerignore
Normal file
1
react-express-mongodb/backend/.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
@@ -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" ]
|
||||
|
Reference in New Issue
Block a user