404 page not found

Hi all, i recently deploy to app platform digital ocean and found page is not found, however in local(without docker) everything is fine. and after that, i just want to know how to run it on my local docker, and again find my app page is not found. everything looks like this
No description
4 Replies
alfianwilfo
alfianwilfoOP5mo ago
here's my dockerfile
# Use the official Node.js image as the base image
FROM node:18

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Nuxt application
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Command to run the Nuxt application
CMD [ "npm", "run", "start" ]
# Use the official Node.js image as the base image
FROM node:18

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Build the Nuxt application
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Command to run the Nuxt application
CMD [ "npm", "run", "start" ]
alfianwilfo
alfianwilfoOP5mo ago
here's my package json
No description
oneeach
oneeach5mo ago
this is what I have in my Dockerfile to run my project: ENTRYPOINT [ "node", ".output/server/index.mjs" ]
oneeach
oneeach5mo ago
also, you should probably setup a builder image so you don't have to copy over your entire project and node_modules into your image... you only need the build output. Example: https://sachithsiriwardana.medium.com/dockerizing-nodejs-application-with-multi-stage-build-e30477ca572
Want results from more Discord servers?
Add your server