Skip to content

Commit

Permalink
chore: Update the workflow and Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sirateek committed May 14, 2023
1 parent b61fdb5 commit fe28520
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ jobs:

- name: Mount a fake secret file
run: |
echo FakeValue > src/firebaseConfig.json
echo FakeValue > src/GarnBarnApiConfig.json
echo $firebaseConfig > src/firebaseConfig.json
echo $config > src/GarnBarnApiConfig.json
env:
config: ${{ secrets.GARNBARN_FRONTEND_CONFIG }}
firebaseConfig: ${{ secrets.GARNBARN_FIREBASE_CONFIG }}

# Setup BuildX
- name: Set up Docker Buildx
Expand Down
23 changes: 19 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Builder
FROM node:12-alpine AS builder
## Builder Stage
FROM node:12-alpine AS build-stage

WORKDIR /app

Expand All @@ -13,6 +13,21 @@ RUN yarn install
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .

EXPOSE 8080
# Build
RUN yarn run build

CMD ["yarn", "serve"]
# Remove sourcemap file before send output to production-stage
RUN find . -name "*.map" -type f -delete



## Production Stage
FROM nginx:stable-alpine as production-stage

COPY nginx.conf /etc/nginx/nginx.conf

COPY --from=build-stage /app/dist /usr/share/nginx/html/


EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit fe28520

Please sign in to comment.