Skip to content

Comments

Fix: Correct COPY command syntax in frontend production Dockerfile#2086

Open
trillium wants to merge 2 commits intodevelopmentfrom
fix/frontend-dockerfile-copy-command
Open

Fix: Correct COPY command syntax in frontend production Dockerfile#2086
trillium wants to merge 2 commits intodevelopmentfrom
fix/frontend-dockerfile-copy-command

Conversation

@trillium
Copy link
Member

Summary

  • Fixed invalid COPY command syntax in client/Dockerfile.prod that was causing frontend Docker build failures
  • Changed COPY --chown=node:node package.json package.json ./ to COPY --chown=node:node package*.json ./

Problem

The "Frontend Build and Deploy" GitHub Action was failing on 2026-02-12 with exit code 1 during the "Build, tag, and push the image to Amazon ECR" step. The issue was caused by an invalid COPY command on line 6 of the Dockerfile that attempted to copy package.json twice.

Solution

Updated the COPY command to use the package*.json glob pattern, which:

  • Properly copies package.json
  • Will also copy package-lock.json if present
  • Matches the pattern used in the backend Dockerfile (backend/Dockerfile.prod:5)

Changes

  • client/Dockerfile.prod:6 - Fixed COPY command syntax

Test Plan

  • Verify Docker build succeeds locally (if Docker is available)
  • Trigger the "Frontend Build and Deploy" workflow to verify it completes successfully
  • Verify the Docker image builds without errors in the GitHub Actions environment

References

🤖 Generated with Claude Code

Fixed two build errors preventing the frontend Docker image from building:

1. Removed duplicate 'display' key in loadingStyle object (ManageProjects.jsx)
   - The loadingStyle object had both "display": "none" and "display": "flex"
   - Kept "display": "flex" which is correct for the loading overlay
   - Introduced in commit 3a25f7f by JamesNg on 2025-01-29

2. Replaced non-existent StyledButton import with MUI Button (buttonGroup.jsx)
   - Component was importing StyledButton from ProjectForm.jsx
   - StyledButton export was removed in commit 8e9ac7b by Kaipher on 2025-10-06
   - Component was created in commit cf194d2 by JamesNg on 2025-09-29
   - Updated to use standard MUI Button component with matching styles

Build errors resolved:
- "Duplicate key 'display' in object literal"
- "StyledButton is not exported by src/components/ProjectForm.jsx"

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@trillium trillium force-pushed the fix/frontend-dockerfile-copy-command branch from fba1e9c to 02e783c Compare February 15, 2026 05:56
trillium added a commit that referenced this pull request Feb 15, 2026
Fixed two syntax errors in the frontend production Dockerfile that were masked by earlier build failures:

1. Line 6: COPY command syntax error
   - Changed: COPY --chown=node:node package.json package.json ./
   - To: COPY --chown=node:node package*.json ./
   - The original attempted to copy package.json twice (invalid syntax)
   - Now uses glob pattern to properly copy package.json and package-lock.json if present
   - Matches the pattern used in backend/Dockerfile.prod:5

2. Lines 15-16: Missing equals signs in ARG and ENV directives
   - Changed: ARG CUSTOM_REQUEST_HEADER nAb3kY-S%qE#4!d
   - To: ARG CUSTOM_REQUEST_HEADER=nAb3kY-S%qE#4!d
   - Changed: ENV REACT_APP_CUSTOM_REQUEST_HEADER $CUSTOM_REQUEST_HEADER
   - To: ENV REACT_APP_CUSTOM_REQUEST_HEADER=$CUSTOM_REQUEST_HEADER
   - Ensures proper Dockerfile syntax compliance

These errors were present in the original file but were not caught because the build was failing earlier due to code issues (duplicate object keys and missing exports) that have been fixed in PR #2086.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
@JackHaeg JackHaeg requested a review from kkchu791 February 17, 2026 03:13
Copy link
Member

@kkchu791 kkchu791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@geolunalg geolunalg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants