fixing deployment AGAIN

This commit is contained in:
ngn 2023-11-12 19:18:10 +03:00
parent 556ebe7cd2
commit f00c0601cc
3 changed files with 14 additions and 10 deletions

View File

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

View File

@ -11,4 +11,8 @@ COPY util ./util
EXPOSE 7001
RUN make
ARG PASSWORD
ENV PASS $PASSWORD
ENTRYPOINT ["/app/server"]

View File

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