Conversation
Deploying www-rds with
|
| Latest commit: |
43a5ed7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1cea5511.www-rds.pages.dev |
| Branch Preview URL: | https://setup-dockerize-app.www-rds.pages.dev |
|
Currently the app is not running in docker container(in terminal I am getting correct output) and when I am running normally(means without docker) it is working fine and I can see the app running on the respective port. For docker
For without docker
UpdateThe above issue is resolved more context below So the issue was I was using the command So it was correctly not mapping the port of my machine and the docker machine By using the command docker run -p <host_port>:<container_port> <image_name> it started to map the container port my host port and everything worked fine, I can see my app running in the browser. Updated steps to run docker
|
app/constants/urls.js
Outdated
| // API_BACKEND: `${SCHEME}api.${DOMAIN}`,hostWhitelist | ||
|
|
||
| API_BACKEND: `http://localhost:3000`, | ||
|
|
There was a problem hiding this comment.
Yes was testing, forgot to remove, thanks for pointing it out.
Update it now
fastboot-server.js
Outdated
| // import FastBootAppServer from 'fastboot-app-server'; | ||
|
|
||
| // eslint-disable-next-line no-undef | ||
| const FastBootAppServer = require('fastboot-app-server'); |
There was a problem hiding this comment.
Why are we not using commonjs? and using require?
There was a problem hiding this comment.
I was facing error in other files while I was using es6 code, so that's why instead of changing them I changed this one only
Dockerfile
Outdated
| @@ -0,0 +1,27 @@ | |||
| # Utilize the Node.js 14 official image | |||
There was a problem hiding this comment.
Outdated comment, have updated
| @@ -0,0 +1,27 @@ | |||
| # Utilize the Node.js 14 official image | |||
| FROM node:18-alpine | |||
There was a problem hiding this comment.
What is the current latest version?
There was a problem hiding this comment.
Current version in v20.17.0 using this one because in our volta package 18 version is pinned
Dockerfile
Outdated
| USER root | ||
|
|
||
| # Set the working directory inside the container | ||
| WORKDIR /app | ||
|
|
||
| # Copy the package.json and package-lock.json (if available) | ||
| # COPY package*.json ./ | ||
|
|
||
| # Install the dependencies | ||
|
|
||
|
|
||
| # Copy the rest of the application code | ||
| COPY . . | ||
|
|
||
| RUN yarn install --frozen-lockfile | ||
|
|
||
| # Build the Fastboot app | ||
| RUN yarn build | ||
|
|
||
| # Expose the port the Fastboot app runs on | ||
| EXPOSE 5000 | ||
|
|
||
| # Define the command to run your Fastboot app | ||
| CMD ["node", "fastboot-server"] |
There was a problem hiding this comment.
How does the app know in which env to run
There was a problem hiding this comment.
For this we can have a two docker file one for production and one for staging with two different build commands
Date:
to be filledDeveloper Name:
Satyam BajpaiIssue Ticket Number:-
Description:
Add description of the PR here
Is Under Feature Flag
Database changes
Breaking changes (If your feature is breaking/missing something please mention pending tickets)
Is Development Tested?
Tested in staging?
Add relevant Screenshot below ( e.g test coverage etc. )