diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..6f89412 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +# Use official Node.js image as base +FROM node:18 + +# Set working directory in the container +WORKDIR /app + +# Copy package.json and lock file first (for caching) +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the app +COPY . . + +# Build the app +RUN npm run build + +# Expose port Next.js runs on +EXPOSE 3000 + +# Start the app +CMD ["npm", "start"] diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3541b1f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +.next +Dockerfile +docker-compose.yml +*.log diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c6f4042 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ + +services: + app: + build: + context: . + dockerfile: .devcontainer/Dockerfile + ports: + - "3000:3000" + environment: + - NODE_ENV=production