app docker fixes

This commit is contained in:
ngn 2024-10-06 18:06:31 +03:00
parent 5815a5b193
commit 46c9bfc2c1
3 changed files with 6 additions and 14 deletions

View File

@ -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:

View File

@ -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"]

View File

@ -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