diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f93723d2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: CommitCheck for poc + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" +jobs: + check-commit-message: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check commit message format + id: check-message + run: | + commit_message=$(git log -1 --pretty=%B) + if [[ ! $commit_message =~ ^chan-[a-zA-Z0-9\s\S]* ]]; then + echo "Commit message must start with 'V2FS-', but found: '$commit_message'" + exit 1 + fi + + - name: Continue workflow if check passes + if: ${{ failure() }} + run: echo "Workflow continues as check passed" diff --git a/Dockerfile b/Dockerfile index e8455afe..56e9727a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,24 @@ -FROM node:16.17.0-alpine as builder + +# Use the official Node.js 16 image +FROM node:16 + +# Set the working directory in the container WORKDIR /app -COPY ./package.json . -COPY ./yarn.lock . -RUN yarn install + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the entire React app source code to the container COPY . . -ARG TMDB_V3_API_KEY -ENV VITE_APP_TMDB_V3_API_KEY=${TMDB_V3_API_KEY} -ENV VITE_APP_API_ENDPOINT_URL="https://api.themoviedb.org/3" -RUN yarn build - -FROM nginx:stable-alpine -WORKDIR /usr/share/nginx/html -RUN rm -rf ./* -COPY --from=builder /app/dist . -EXPOSE 80 -ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file + +# Build the React app +RUN npm run build + +# Expose port 3000 (the port your Node.js app runs on) +EXPOSE 3000 + +# Start the Node.js app +CMD ["npm", "start"] diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..bed862f8 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=netflix