-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup: add docker file #930
base: develop
Are you sure you want to change the base?
Conversation
Deploying www-rds with Cloudflare Pages
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not using commonjs? and using require?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why node 14?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the current latest version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the app know in which env to run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this we can have a two docker file one for production and one for staging with two different build commands
Date:
to be filled
Developer Name:
Satyam Bajpai
Issue 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. )