compile server exe in docker and export to /bin/

This commit is contained in:
array-in-a-matrix 2024-07-19 17:30:33 -04:00
parent cce213f902
commit 6e70e4295e
3 changed files with 33 additions and 3 deletions

3
.gitignore vendored
View file

@ -9,6 +9,9 @@ htmldocs/
# file uploads directory
uploads/
# docker build directory
bin/
# database
*.db

View file

@ -13,12 +13,27 @@ nimble install jester norm checksums
Compile and run:
```sh
nimble run --deepcopy:on
nimble run
```
More verbose compilation:
Build project:
```sh
nimble run --deepcopy:on --verbose -d:normDebug --spellSuggest
nimble build
```
## Docker
To compile the binary only, run the following (executable will be found in `/bin/`):
```sh
docker buildx build -t glimpse-server:latest --output=bin --target=runner -f
```
To deploy an instance of the server, run:
```sh
```
## API Endpoints

12
bin.dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM nimlang/nim:latest AS builder
WORKDIR /src
COPY . /src
RUN apt-get -y update && apt-get -y upgrade && apt-get -y autoremove
RUN nimble -y install jester norm checksums
RUN nimble build
FROM scratch AS runner
COPY --from=builder /src/server .