diff --git a/Dockerfile b/Dockerfile index 32bb292..21931cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM node:alpine as builder +# Use the ARM64 Node.js image as the builder stage +FROM node:18-bullseye-slim AS builder ARG VITE_OPENAI_API_KEY=REPLACE_WITH_YOUR_OWN ARG VITE_OPENAI_HOST=REPLACE_WITH_YOUR_OWN @@ -22,8 +23,11 @@ RUN yarn install COPY . . RUN yarn build -FROM nginx:alpine +# Use a smaller ARM64-compatible base image for the final stage +FROM arm64v8/nginx:alpine + COPY nginx.conf /etc/nginx/nginx.conf WORKDIR /usr/share/nginx/html COPY --from=builder /app/dist . + ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md index 1c79f89..a12fe92 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ You can utilize this app to improve your language speaking skills or simply have [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fhahahumble%2Fspeechgpt&env=VITE_OPENAI_API_KEY,VITE_OPENAI_HOST,VITE_AWS_REGION,VITE_AWS_ACCESS_KEY_ID,VITE_AWS_ACCESS_KEY,VITE_AZURE_REGION,VITE_AZURE_KEY&envDescription=If%20you%20do%20not%20want%20to%20provide%20a%20value%2C%20use%20REPLACE_WITH_YOUR_OWN.&project-name=speechgpt&repository-name=speechgpt) ### Deploying with Docker -1. Pull the Docker image. +1. Pull the Docker image:arm64. ```bash docker pull hahahumble/speechgpt ``` @@ -72,7 +72,7 @@ docker run -d -p 8080:8080 --name speechgpt hahahumble/speechgpt ### Building and running the Docker image 1. Build the Docker image. ```bash -docker build -t speechgpt . +docker build -t speechgpt:arm64 -f Dockerfile . ``` 2. Run the Docker container.