From cf1f240f6a1a885a310b95b9e8c97f4b60146c02 Mon Sep 17 00:00:00 2001 From: Nikita Knutov Date: Thu, 9 Nov 2023 19:44:43 +0100 Subject: [PATCH 1/2] Simplest docker implementation --- Dockerfile | 6 ++++++ README.md | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3f255738 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM node:21 + +COPY . /app +WORKDIR /app +RUN npm install +CMD ["npm","run","dev"] diff --git a/README.md b/README.md index 1a4be168..31b30bf2 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,14 @@ npm install npm run dev ``` +## Docker + +To run this app as a docker container do the following: + +```bash +echo "OPENAI_API_KEY=sk-your-key" > .env.local +docker build -t draw-a-ui:latest . +docker run --env-file .env.local -p 3000 -d --name draw-ai draw-a-ui:latest +``` + Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. From 9137d711f898c89c04d368c79220e834cc9eec09 Mon Sep 17 00:00:00 2001 From: Nikita Knutov Date: Thu, 9 Nov 2023 20:26:11 +0100 Subject: [PATCH 2/2] fix doc to expose exact port,not random one --- Dockerfile | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3f255738..be1b111b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,3 +4,4 @@ COPY . /app WORKDIR /app RUN npm install CMD ["npm","run","dev"] +EXPOSE 3000 diff --git a/README.md b/README.md index 31b30bf2..d1be2b86 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To run this app as a docker container do the following: ```bash echo "OPENAI_API_KEY=sk-your-key" > .env.local docker build -t draw-a-ui:latest . -docker run --env-file .env.local -p 3000 -d --name draw-ai draw-a-ui:latest +docker run --env-file .env.local -p 3000:3000 -d --name draw-ai draw-a-ui:latest ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.