-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from Dogtiti/refactor/docker
fix: refactor docker
- Loading branch information
Showing
16 changed files
with
343 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
FROM node:19-alpine | ||
|
||
RUN apk update && apk add --no-cache openssl | ||
|
||
ARG NEXTAUTH_SECRET=$(openssl rand -base64 32) | ||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET | ||
|
||
ARG DATABASE_URL | ||
ENV DATABASE_URL=$DATABASE_URL | ||
|
||
ARG NEXTAUTH_SECRET= | ||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET | ||
|
||
ARG NEXTAUTH_URL | ||
ENV NEXTAUTH_URL=$NEXTAUTH_URL | ||
|
||
ARG SKIP_ENV_VALIDATION | ||
ENV SKIP_ENV_VALIDATION=$SKIP_ENV_VALIDATION | ||
|
||
WORKDIR /app | ||
|
||
|
||
|
||
# Install dependencies based on the preferred package manager | ||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Prevent Husky errors by disabling the `prepare` script | ||
RUN npm pkg set scripts.prepare="exit 0" | ||
|
||
# set npm registry | ||
RUN npm config set registry 'https://registry.npmmirror.com/' | ||
|
||
RUN \ | ||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ | ||
elif [ -f package-lock.json ]; then npm ci; \ | ||
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \ | ||
# Allow install without lockfile, so example works even without Node.js installed locally | ||
else echo "Warning: Lockfile not found. It is recommended to commit lockfiles to version control." && yarn install; \ | ||
fi | ||
|
||
|
||
|
||
|
||
ENTRYPOINT ["sh", "entrypoint.sh"] | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line to disable telemetry at run time | ||
# ENV NEXT_TELEMETRY_DISABLED 1 | ||
|
||
# Note: Don't expose ports here, Compose will handle that for us | ||
|
||
# Start Next.js in development mode based on the preferred package manager | ||
CMD \ | ||
if [ -f yarn.lock ]; then yarn dev; \ | ||
elif [ -f package-lock.json ]; then npm run dev; \ | ||
elif [ -f pnpm-lock.yaml ]; then pnpm dev; \ | ||
else yarn dev; \ | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
version: '3' | ||
|
||
volumes: | ||
db: | ||
src: | ||
public: | ||
|
||
services: | ||
autogpt: | ||
build: | ||
context: . | ||
dockerfile: dev.Dockerfile | ||
args: | ||
NEXTAUTH_URL: http://localhost:3000 | ||
DATABASE_URL: file:./db.sqlite | ||
SKIP_ENV_VALIDATION: 1 # omit this property to enable schema validation for the environment variables | ||
container_name: autogpt | ||
environment: | ||
OPENAI_API_KEY: ${OPENAI_API_KEY} # openai api key | ||
NEXT_PUBLIC_WEB_SEARCH_ENABLED: ${NEXT_PUBLIC_WEB_SEARCH_ENABLED} # enable web search | ||
SERP_API_KEY: ${SERP_API_KEY} # serp api key | ||
NEXT_PUBLIC_GUEST_KEY: ${NEXT_PUBLIC_GUEST_KEY} # guest key | ||
ports: | ||
- 3000:3000 | ||
volumes: | ||
- src:/app/src | ||
- public:/app/public | ||
- db:/app/db | ||
restart: unless-stopped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3' | ||
|
||
services: | ||
autogpt: | ||
container_name: autogpt | ||
image: dogtititi/autogpt-next-web:lastest | ||
# build: | ||
# context: . | ||
# dockerfile: prod.Dockerfile | ||
# args: | ||
# NEXTAUTH_URL: http://localhost:3000 | ||
# DATABASE_URL: file:./db.sqlite | ||
# OPENAI_API_KEY: ${OPENAI_API_KEY} # openai api key | ||
# NEXT_PUBLIC_WEB_SEARCH_ENABLED: ${NEXT_PUBLIC_WEB_SEARCH_ENABLED} # enable web search | ||
# SERP_API_KEY: ${SERP_API_KEY} # serp api key | ||
# NEXT_PUBLIC_GUEST_KEY: ${NEXT_PUBLIC_GUEST_KEY} # guest key | ||
# NEXT_PUBLIC_FF_AUTH_ENABLED: ${NEXT_PUBLIC_FF_AUTH_ENABLED} # auth enable | ||
# GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} # google client id | ||
# GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} # google client secret | ||
# GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID} # github client id | ||
# GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} # github client secret | ||
# DISCORD_CLIENT_ID: ${DISCORD_CLIENT_ID} # discord client id | ||
# DISCORD_CLIENT_SECRET: ${DISCORD_CLIENT_SECRET} # discord client secret | ||
ports: | ||
- 3000:3000 | ||
restart: unless-stopped |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
78055a6
There was a problem hiding this comment.
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:
auto-gpt-next-web – ./
auto-gpt-next-web-dogtiti.vercel.app
auto-gpt-next-web-git-main-dogtiti.vercel.app
auto-agentgpt.com