Skip to content
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

Main #21

Open
wants to merge 3 commits into
base: starter
Choose a base branch
from
Open

Main #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use Node.js as the base image
FROM node:18

# Set the working directory inside the container
WORKDIR /app

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

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Generate Database
RUN npx prisma generate

# Build the Next.js application
RUN npm run build

# Expose the port the app runs on
EXPOSE 3000

# Start the Next.js application
CMD ["npm", "run", "start"]
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.8"


services:
postgres:
image: postgres:15
container_name: postgres_db
environment:
POSTGRES_USER:myuser
POSTGRES_PASSWORD:mypassword
POSTGRES_DB:mydb
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data

app:
container_name: nextjs_app
ports:
- '3000:3000'
environment:
- DATABASE_URL: postgresql://myuser:mypassword@localhost:5432/mydb
depends_on:
- postgres
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
images: {
remotePatterns: [{ hostname: "images.pexels.com" },{ hostname: "res.cloudinary.com" } ],
},
};

export default nextConfig;
Loading