diff --git a/README.md b/README.md index 7cdfdf4..992f8d7 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ services: app: build: context: ./app - environment: - - API_URL="https://api.ngn.tf" + args: + API_URL: https://api.ngn.tf ports: - "127.0.0.1:7002:3000" depends_on: diff --git a/app/Dockerfile b/app/Dockerfile index 95fa40b..c5b4e06 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -3,22 +3,21 @@ FROM node:22.8.0 as build WORKDIR /app COPY . /app -ENV VITE_API_URL_DEV http://placeholder/ +ARG API_URL +ENV VITE_API_URL_DEV $API_URL RUN npm install && npm run build -FROM oven/bun:1.1 as main +FROM oven/bun:1.1.20 as main WORKDIR /app COPY --from=build /app/build ./build -COPY --from=build /app/docker ./docker COPY --from=build /app/package.json ./package.json COPY --from=build /app/package-lock.json ./package-lock.json EXPOSE 4173 RUN bun install -RUN chmod +x ./docker/entry.sh -CMD ["./docker/entry.sh"] +CMD ["bun", "build/index.js"] diff --git a/app/docker/entry.sh b/app/docker/entry.sh deleted file mode 100644 index 5dcdb7c..0000000 --- a/app/docker/entry.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# replace the API URL -find ./build -type f -exec sed "s/http:\/\/placeholder\//${API_URL//\//\\/}/g" -i "{}" \; - -# start the application -bun build/index.js