Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client,docker) refactor build #1028

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions scripts/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ fi
DOCKER_REPO=103425057857.dkr.ecr.us-west-2.amazonaws.com/jitsi/spot-client

cd spot-client
rm -rf node_modules
rm -rf dist
npm install
export SPOT_CLIENT_VERSION=$TAG
npm run build:prod

echo "{ \"spotClientVersion\": \"$TAG\" }" > ./dist/spot-client-version.json
docker build --build-arg SPOT_CLIENT_VERSION=$TAG -t $DOCKER_REPO:$TAG --platform linux/amd64 .

aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 103425057857.dkr.ecr.us-west-2.amazonaws.com
docker build -t $DOCKER_REPO:$TAG --platform linux/amd64 .
docker push $DOCKER_REPO:$TAG
15 changes: 12 additions & 3 deletions spot-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
FROM node:16-alpine as builder
ARG SPOT_CLIENT_VERSION=dev

ADD . /build
WORKDIR /build
RUN \
echo "Building version: ${SPOT_CLIENT_VERSION}" && \
npm install && \
npm run build:prod && \
echo "{ \"spotClientVersion\": \"${SPOT_CLIENT_VERSION}\" }" > dist/spot-client-version.json

FROM nginx
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY index.html /usr/share/nginx/html
COPY dist /usr/share/nginx/html/dist


COPY --from=builder /build/dist /usr/share/nginx/html/dist