Skip to content

Commit

Permalink
updating customers
Browse files Browse the repository at this point in the history
  • Loading branch information
ApurvaBasule committed Aug 15, 2024
1 parent 9072508 commit 0213836
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git

*/node_modules

server/public
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:lts-alpine

WORKDIR /app

# Copy and install dependencies for the client
COPY client/package*.json ./client/
RUN npm install --prefix client --omit=dev

# Copy and install dependencies for the server
COPY server/package*.json ./server/
RUN npm install --prefix server --omit=dev

# Copy the rest of the client files and build the client
COPY client/ ./client/
RUN npm run build --prefix client

# Copy the server files after the client is built
COPY server/ ./server/

# Ensure the server/public directory exists
RUN mkdir -p ./server/public

# Move the built client files to the server's public directory
RUN cp -R ./client/build/* ./server/public/

USER node

# Start the server
CMD ["npm", "start", "--prefix", "server"]

# Expose the port
EXPOSE 5000

2 changes: 1 addition & 1 deletion client/src/hooks/requests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const API_URL = 'http://localhost:5000/v1';
const API_URL = 'v1';

async function httpGetPlanets() {
const response = await fetch(`${API_URL}/planets`);
Expand Down
2 changes: 1 addition & 1 deletion server/src/models/launches.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function addNewLaunch(launch) {
...launch,
success: true,
upcoming: true,
customers: ['Zero to Mastery', 'NASA'],
customers: ['ORS', 'NASA'],
flightNumber: await getLatestFlightNumber() + 1,
};

Expand Down

0 comments on commit 0213836

Please sign in to comment.