generated from metakgp/README.md
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from metakgp/backend-rs
[HOLY WAR] Rustified Backend
- Loading branch information
Showing
46 changed files
with
1,650 additions
and
881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
STATIC_FILES_URL=https://static.metakgp.org | ||
DB_NAME= | ||
DB_HOST= | ||
DB_PORT= | ||
DB_USER= | ||
DB_PASSWORD= | ||
STATIC_FILES_STORAGE_LOCATION=/srv/static | ||
UPLOADED_QPS_PATH=iqps/uploaded # Relative to `STATIC_FILES_STORAGE_LOCATION`. Final upload location will be /srv/static/iqps/uploaded | ||
MAX_UPLOAD_LIMIT=10 | ||
GH_CLIENT_ID= # public token of the oauth app | ||
GH_PRIVATE_ID= # Private token of the oauth app | ||
JWT_SECRET= # JWT encryption secret | ||
GH_ORG_NAME= # name of the org | ||
GH_ORG_TEAM_SLUG= #URL friendly team Name | ||
GH_ORG_ADMIN_TOKEN= #GH TOKEN OF AN ORG ADMIN | ||
IQPS_LOG_LOCATION=./log/application.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM golang:1.22.4 AS builder | ||
|
||
WORKDIR /src | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux go build -o ./build --tags "fts5" -a -ldflags '-linkmode external -extldflags "-static"' . | ||
|
||
FROM alpine:latest AS app | ||
|
||
RUN apk --no-cache add tzdata ca-certificates bash | ||
|
||
ENV TZ="Asia/Kolkata" | ||
|
||
WORKDIR /app | ||
|
||
COPY metaploy/ ./ | ||
|
||
RUN chmod +x ./postinstall.sh | ||
|
||
COPY --from=builder /src/build . | ||
|
||
CMD ["./postinstall.sh", "./build"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
services: | ||
iqps-backend: | ||
image: metakgporg/iqps-backend | ||
container_name: iqps-backend | ||
build: . | ||
restart: always | ||
env_file: | ||
- .env | ||
networks: | ||
metaploy-network: | ||
aliases: | ||
- iqps-backend | ||
metaploy-private-network: | ||
volumes: | ||
- ./logs:/var/log/iqps/logs | ||
- ./db:/db | ||
- nginx-config-volume:/etc/nginx/sites-enabled | ||
- odins-vault:/srv/static | ||
|
||
networks: | ||
metaploy-network: | ||
external: true | ||
name: metaploy-network | ||
metaploy-private-network: | ||
external: true | ||
name: metaploy-private-network | ||
|
||
volumes: | ||
nginx-config-volume: | ||
external: true | ||
name: metaploy-nginx-config-volume | ||
odins-vault: | ||
external: true | ||
name: odins-vault |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
upstream iqps_server { | ||
server iqps-backend:5000; | ||
} | ||
|
||
server { | ||
server_name iqps-server.metakgp.org; | ||
|
||
location / { | ||
proxy_pass http://iqps_server; | ||
} | ||
|
||
location /upload { | ||
proxy_pass http://iqps_server; | ||
client_max_body_size 50m; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
cleanup() { | ||
echo "Container stopped. Removing nginx configuration." | ||
rm /etc/nginx/sites-enabled/iqps.metaploy.conf | ||
} | ||
|
||
trap 'cleanup' SIGQUIT SIGTERM SIGHUP | ||
|
||
"${@}" & | ||
|
||
cp ./iqps.metaploy.conf /etc/nginx/sites-enabled | ||
|
||
wait $! |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.