Skip to content

Commit

Permalink
Merge pull request #19 from KennyDizi/v2
Browse files Browse the repository at this point in the history
Offer SDK v4, NextJS v13 and Docker
  • Loading branch information
1998code authored Sep 4, 2023
2 parents d534556 + fd875a6 commit b2bf2de
Show file tree
Hide file tree
Showing 9 changed files with 3,589 additions and 1,574 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use the official Node.js v18 image as the base image
FROM node:18

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

# Copy package.json and package-lock.json before other files
# Utilize Docker cache to save re-installing dependencies if unchanged
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy all project files into the container
COPY . .

# Build the Next.js app
RUN npm run build

# Expose the port the app will run on
EXPOSE 3000

# Command to run the application
CMD ["npm", "start"]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: start-local
start-local:
npm run build && npm run start

.PHONY: start-docker-compose-local
start-docker-compose-local:
docker-compose up --build -d
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DALLE 2 App (Next.js)
# DALL-E 2 App (Next.js)
### Create realistic images and art from a description in natural language.

[![DeepScan grade](https://deepscan.io/api/teams/18632/projects/21948/branches/641242/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=18632&pid=21948&bid=641242)
Expand Down Expand Up @@ -26,6 +26,11 @@ npm run dev
yarn dev
```

### If you prefer docker, run this command
```
docker-compose up --build -d
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3'
services:
images-generator-with-dalle-2:
build: .
ports:
- '3000:3000'
environment:
- NODE_ENV=production
Loading

1 comment on commit b2bf2de

@vercel
Copy link

@vercel vercel bot commented on b2bf2de Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dalle-2-app – ./

dalle-2-app-1998code.vercel.app
dalle2.vercel.app
dalle-2-app-git-v2-1998code.vercel.app

Please sign in to comment.