Open in Discord
Greek Harehound posted this in #help-forum
How can I deploy the website without including the source codes with docker?
what does your dockerfile looks like actually ?
I don't have a docker file
I'm just asking
Just create your dockerfile and specify which files you are moving to your container (in your case the build folder for Next.js) `
# Use an official Node.js runtime as a base image
# Set the working directory inside the container
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install dependencies
RUN npm install --production
# Copy the built Next.js application to the container
COPY .next ./.next
# Expose the port that your application will run on
# Define the command to run your application
CMD ["npm", "start"]
So i should include the .next and module folders and it will work right?
I'm thinking of making a template and selling it and I don't want people to have the source code, do you think this method is good or is there a better method?
I mean yeah, since they don't have access to the source code that should be possible but regarding security idk
thank you ray
Do I need to include pages and components directory in this example?
I don't want to include source code in VPS
if you build with that dockerfile, it won't include any source code
I just want to
Use the .next file
and start it