Skip to content
Snippets Groups Projects
Commit 41216d15 authored by Lukáš Kratochvíl's avatar Lukáš Kratochvíl
Browse files

feat: client Dockerfile - added comments so we understand what is happening...

feat: client Dockerfile - added comments so we understand what is happening and why, fix: corrected copying of package-lock.json
parent dd9bc287
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ services:
context: ./backend
dockerfile: Dockerfile
# change target in order to run in different environment ('development' or 'production' environment, see ./backend/Dockerfile)
target: production
target: development
ports:
- 127.0.0.1:${SERVER_PORT}:${SERVER_PORT}
networks:
......@@ -92,6 +92,7 @@ services:
# changes in host's ./frontend directory will be propagated to the container
- ./frontend:/usr/src/app
# this prevents our host files from overriding container's node_modules
# – some packages may be platform specific so we always want to run 'npm i' in the container when new package is added
- exclude-client:/usr/src/app/node_modules/
environment:
- PORT=${CLIENT_PORT}
......
FROM node:16-alpine
# install node_modules outside app root in container so local development won't run into a problem of bind-mounting over it with local source code
WORKDIR /usr/src
COPY ["package.json", "package-lock.json*", "./"]
COPY ["package.json", "package-lock.json", "./"]
RUN npm install
# ensures that exactly these executables (from the node_modules folder) are used instead of any other executables which might also be installed on the system inside the Docker image
ENV PATH=/usr/src/node_modules/.bin:$PATH
WORKDIR /usr/src/app
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment