Skip to content

Final working Azure Docker deployment#36

Open
shaziamughal wants to merge 4 commits into
bradtraversy:mainfrom
shaziamughal:feature/dockerize-app
Open

Final working Azure Docker deployment#36
shaziamughal wants to merge 4 commits into
bradtraversy:mainfrom
shaziamughal:feature/dockerize-app

Conversation

@shaziamughal
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 20:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds goal editing functionality in the frontend and introduces deployment-oriented changes (runtime API base URL support, Nginx reverse proxy, and Dockerfiles) while adjusting how the backend is started/served in production.

Changes:

  • Add “Edit goal” modal UI and Redux thunk/service support for updating goals.
  • Introduce apiUrl() helper + runtime env injection hook (env.js) and remove CRA dev proxy.
  • Add Docker/Nginx configs and adjust backend production behavior and dotenv loading.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
frontend/src/index.css Adds styles for goal action buttons and modal dialog (including responsive tweaks).
frontend/src/features/goals/goalSlice.js Adds updateGoal async thunk and reducers to update a goal in state.
frontend/src/features/goals/goalService.js Switches to apiUrl()-based endpoint building and adds updateGoal() API call.
frontend/src/features/auth/authService.js Alters auth endpoints (but currently builds URLs incorrectly).
frontend/src/components/GoalItem.jsx Adds edit modal UI and dispatches updateGoal from the goal item.
frontend/src/app/apiUrl.js Adds helper to build API URLs from runtime/build-time env.
frontend/public/index.html Loads %PUBLIC_URL%/env.js for runtime env injection.
frontend/package.json Removes CRA dev proxy configuration.
frontend/nginx.conf Adds Nginx config to serve SPA and proxy /api/ to backend.
frontend/docker/README.md Documents runtime env injection approach for the frontend image.
frontend/Dockerfile Adds frontend multi-stage Docker build (Node build → Nginx serve).
frontend/.env.example Adds example API URL env var for frontend.
frontend/.dockerignore Adds dockerignore for frontend image builds.
backend/server.js Loads dotenv from repo root .env and changes production routing behavior.
backend/docker/README.md Adds build/run instructions (currently includes real credentials).
backend/docker/Dockerfile Adds backend Dockerfile (runs node backend/server.js).
backend/Dockerfile Adds alternative backend Dockerfile (runs node server.js from /app/backend).
backend/.dockerignore Adds dockerignore for backend image builds.
.envexample Updates env example (currently includes real credentials).
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1 to +8
import axios from 'axios'
import { apiUrl } from '../../app/apiUrl'

// const API_URL = apiUrl('/api/users')
const API_URL = '/api/users/'

// Register user
const register = async (userData) => {
const response = await axios.post(API_URL, userData)
const response = await axios.post(`${API_URL}/`, userData)
// Login user
const login = async (userData) => {
const response = await axios.post(API_URL + 'login', userData)
const response = await axios.post(`${API_URL}/login`, userData)
Comment on lines +31 to +32
<!-- Runtime env (generated by container entrypoint) -->
<script src="%PUBLIC_URL%/env.js"></script>
Comment on lines +23 to +34
const onUpdate = async (e) => {
e.preventDefault()

await dispatch(
updateGoal({
id: goal._id,
goalData: { text },
})
)

closeEditPopup()
}
Comment on lines +54 to +62
{isEditing && (
<div className='modal-backdrop' onClick={closeEditPopup}>
<div className='modal' onClick={(e) => e.stopPropagation()}>
<div className='modal-header'>
<h3>Update Goal</h3>
<button className='modal-close' onClick={closeEditPopup}>
×
</button>
</div>
Comment thread backend/server.js
Comment on lines +21 to +23
app.get('/', (req, res) => {
res.send('API is running...')
})
Comment thread .envexample Outdated
Comment on lines 3 to 4
MONGO_URI = mongodb+srv://shizzuzeal:shizzuzeal@notesapp-cluster.d7n2tci.mongodb.net/?appName=notesapp-cluster
JWT_SECRET = abc123 No newline at end of file
Comment thread backend/docker/README.md Outdated
Updated the example Docker run command with a generic username and password for better security practices.
Updated MONGO_URI to use placeholder credentials.
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.

2 participants