diff --git a/README.md b/README.md index c0d929b..1f764f6 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,8 @@ services: - "127.0.0.1:7002:4173" depends_on: - api - env_file: all.env + args: + API_URL: "https://api.ngn.tf" api: build: ./api @@ -49,12 +50,8 @@ services: - "127.0.0.1:7001:7001" volumes: - ./api/api.db:/api.db - env_file: all.env -``` -Enviroment variables can be set in the `all.env` file: -```env -PASS=securepassword -VITE_API_URL_DEV="https://api.ngn.tf" + args: + PASSWORD: "supersecure" ``` ## History diff --git a/api/Dockerfile b/api/Dockerfile index 58246a6..8530a25 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -11,4 +11,8 @@ COPY util ./util EXPOSE 7001 RUN make + +ARG PASSWORD +ENV PASS $PASSWORD + ENTRYPOINT ["/app/server"] diff --git a/app/Dockerfile b/app/Dockerfile index b3940c2..c349d91 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,11 +1,14 @@ FROM node:20-alpine3.17 as build -RUN apk update && apk upgrade && adduser -D svelte -USER svelte +RUN apk update && apk upgrade WORKDIR /app -COPY --chown=svelte:svelte . /app +COPY . /app EXPOSE 4173 + +ARG API_URL +ENV VITE_API_URL_DEV $API_URL + RUN npm install && npm run build CMD ["npm", "run", "preview"]