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" - "127.0.0.1:7002:4173"
depends_on: depends_on:
- api - api
env_file: all.env args:
API_URL: "https://api.ngn.tf"
api: api:
build: ./api build: ./api
@ -49,12 +50,8 @@ services:
- "127.0.0.1:7001:7001" - "127.0.0.1:7001:7001"
volumes: volumes:
- ./api/api.db:/api.db - ./api/api.db:/api.db
env_file: all.env args:
``` PASSWORD: "supersecure"
Enviroment variables can be set in the `all.env` file:
```env
PASS=securepassword
VITE_API_URL_DEV="https://api.ngn.tf"
``` ```
## History ## History

View File

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

View File

@ -1,11 +1,14 @@
FROM node:20-alpine3.17 as build FROM node:20-alpine3.17 as build
RUN apk update && apk upgrade && adduser -D svelte RUN apk update && apk upgrade
USER svelte
WORKDIR /app WORKDIR /app
COPY --chown=svelte:svelte . /app COPY . /app
EXPOSE 4173 EXPOSE 4173
ARG API_URL
ENV VITE_API_URL_DEV $API_URL
RUN npm install && npm run build RUN npm install && npm run build
CMD ["npm", "run", "preview"] CMD ["npm", "run", "preview"]