Skip to content

Commit

Permalink
fix: add dockerfile for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
NishaSharma14 committed Mar 15, 2023
1 parent 40e083a commit a566798
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
# Build the Docker image
- name: Build Image
run: |-
docker build -f Dockerfile.prod --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
docker build -f Dockerfile.dev --tag europe-west3-docker.pkg.dev/$PROJECT_ID/$REPOSITORY_NAME_DEV/$IMAGE:latest .
# Push the Docker image to Google Artifact Registry
- name: Publish Image to Google Artifact Registry
run: |-
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# build environment
FROM node:18-alpine3.14 as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN export NODE_OPTIONS=--max-old-space-size=8192
RUN npm ci --silent
RUN npm install react-scripts@latest -g --silent
COPY . ./
RUN npm run build

# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit a566798

Please sign in to comment.