-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚚(docker) move frontend docker config
Move frontend docker config to src/frontend/Dockerfile.
- Loading branch information
Showing
5 changed files
with
51 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,54 @@ | ||
FROM node:20-alpine as y-webrtc-signaling | ||
FROM node:20 as frontend-deps | ||
|
||
WORKDIR /home/frontend/ | ||
|
||
COPY ./package.json . | ||
COPY ./apps/y-webrtc-signaling/package.json ./apps/y-webrtc-signaling/ | ||
COPY ./packages/eslint-config-impress/package.json ./packages/eslint-config-impress/ | ||
COPY ./src/frontend/package.json ./package.json | ||
COPY ./src/frontend/yarn.lock ./yarn.lock | ||
COPY ./src/frontend/apps/impress/package.json ./apps/impress/package.json | ||
COPY ./src/frontend/apps/y-webrtc-signaling/package.json ./apps/y-webrtc-signaling/package.json | ||
COPY ./src/frontend/packages/i18n/package.json ./packages/i18n/package.json | ||
COPY ./src/frontend/packages/eslint-config-impress/package.json ./packages/eslint-config-impress/package.json | ||
|
||
RUN yarn install | ||
RUN yarn install --frozen-lockfile | ||
|
||
COPY . . | ||
COPY ./src/frontend/ . | ||
|
||
# Copy entrypoint | ||
COPY ./docker/files/usr/local/bin/entrypoint /usr/local/bin/entrypoint | ||
|
||
# ---- y-webrtc-signaling ---- | ||
FROM frontend-deps as y-webrtc-signaling | ||
|
||
# Un-privileged user running the application | ||
ARG DOCKER_USER | ||
USER ${DOCKER_USER} | ||
|
||
WORKDIR /home/frontend/apps/y-webrtc-signaling | ||
RUN yarn build | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint" ] | ||
|
||
CMD ["yarn", "start"] | ||
|
||
### ---- Front-end builder image ---- | ||
FROM frontend-deps as impress | ||
|
||
WORKDIR /home/frontend/apps/impress | ||
RUN yarn build | ||
|
||
CMD ["yarn", "start"] | ||
# ---- Front-end image ---- | ||
FROM nginxinc/nginx-unprivileged:1.25 as frontend-production | ||
|
||
# Un-privileged user running the application | ||
ARG DOCKER_USER | ||
USER ${DOCKER_USER} | ||
|
||
COPY --from=impress \ | ||
/home/frontend/apps/impress/out \ | ||
/usr/share/nginx/html | ||
|
||
COPY ./src/frontend/apps/impress/conf/default.conf /etc/nginx/conf.d | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint" ] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |