fixing docker and deployment

This commit is contained in:
ngn 2023-11-12 18:18:01 +03:00
parent 462c49f61d
commit 63c2ff2d76
4 changed files with 13 additions and 9 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
api/server
api/data.db
*.yaml
*.env

View File

@ -31,8 +31,9 @@ by running `admin_script`.
## Deployment
Easiest way to deploy is to use docker. I have created a `compose.yaml` file so the API and the
frontend application can be deployed easily with just the `docker compose up` command:
frontend application can be deployed easily with just the `docker-compose up` command:
```yaml
version: "3"
services:
app:
build: ./app
@ -40,8 +41,7 @@ services:
- "127.0.0.1:7002:7002"
depends_on:
- api
enviroment:
- VITE_API_URL_DEV="https://api.ngn.tf"
env_file: all.env
api:
build: ./api
@ -49,8 +49,12 @@ services:
- "127.0.0.1:7001:7001"
volumes:
- ./api/api.db:/api.db
enviroment:
- PASS=securepassword
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"
```
## History

2
api/.gitignore vendored
View File

@ -1,2 +1,2 @@
server
api.db
*.db

View File

@ -4,7 +4,7 @@ RUN apk update && apk upgrade && adduser -D svelte
USER svelte
WORKDIR /app
COPY --chown=svelteuser:svelte . /app
COPY --chown=svelte:svelte . /app
RUN npm install && npm run build
CMD ["npm", "run", "preview"]