🚀(docker) dockerize frontend dev

Dockerize the frontend development environment
to make it easy to display the frontend
development environment in the browser.

We don't mix it with the command `make run` to
let it kind of optional to run the frontend
in a docker container. We let it optional because
the hot reload doesn't work well in the docker
container. The volume synch make it a bit slower
as well. So, we let the developer decide to run
the frontend in a docker container or not.
This commit is contained in:
Anthony LC
2024-05-30 15:20:55 +02:00
committed by Anthony LC
parent 926fe37e85
commit 06af320d61
5 changed files with 33 additions and 20 deletions

View File

@@ -39,6 +39,7 @@ COPY ./src/frontend/packages/eslint-config-impress/package.json ./packages/eslin
RUN yarn install --frozen-lockfile
COPY .dockerignore ./.dockerignore
COPY ./src/frontend/ .
### ---- Front-end builder image ----
@@ -46,6 +47,14 @@ FROM frontend-deps as impress
WORKDIR /home/frontend/apps/impress
FROM frontend-deps as impress-dev
WORKDIR /home/frontend/apps/impress
EXPOSE 3000
CMD [ "yarn", "dev"]
# Tilt will rebuild impress target so, we dissociate impress and impress-builder
# to avoid rebuilding the app at every changes.
FROM impress as impress-builder
@@ -70,4 +79,4 @@ COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint
ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]