-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.github/ | ||
.vscode/ | ||
test/ | ||
test-collection/ | ||
frontend/ | ||
postman/ | ||
oj-lab-services-structure.drawio |
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 @@ | ||
[log] | ||
level = "debug" | ||
|
||
[database] | ||
dsn = "user=postgres password=development host=host.docker.internal port=5432 dbname=oj_lab sslmode=disable TimeZone=Asia/Shanghai" | ||
|
||
[jwt] | ||
secret = "example_secret" | ||
duration = "24h" | ||
|
||
[service] | ||
auth_on = true | ||
port = ":8080" | ||
cookie.age = "24h" | ||
mode = "debug" | ||
swagger_on = true | ||
serve_front = true | ||
|
||
[judger] | ||
host = "http://host.docker.internal:8000" | ||
|
||
[minio] | ||
endpoint = "host.docker.internal:9000" | ||
accessKeyID = "minio-root-user" | ||
secretAccessKey = "minio-root-password" | ||
useSSL = false | ||
bucketName = "oj-lab-problem-package" |
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 @@ | ||
FROM golang:latest as build | ||
|
||
COPY application/ /usr/src/application/ | ||
COPY core/ /usr/src/core/ | ||
COPY service/ /usr/src/service/ | ||
COPY go.mod /usr/src/go.mod | ||
COPY go.sum /usr/src/go.sum | ||
COPY Makefile /usr/src/Makefile | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN apt update && apt install -y make | ||
RUN make build | ||
|
||
|
||
FROM ubuntu:latest | ||
|
||
COPY --from=build /usr/src/bin/service /usr/local/bin/oj-lab-service | ||
|
||
RUN apt update && apt install -y make zip curl | ||
|
||
RUN mkdir /workspace | ||
COPY config/production.toml /workspace/config/production.toml | ||
WORKDIR /workspace | ||
|
||
COPY Makefile /workspace/Makefile | ||
COPY script/ /workspace/script/ | ||
RUN make get-front | ||
RUN apt install -y strace | ||
|
||
ENV OJ_LAB_SERVICE_ENV=production | ||
ENV OJ_LAB_PROJECT_ROOT=workspace | ||
EXPOSE 8080 | ||
CMD [ "oj-lab-service" ] |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/OJ-lab/oj-lab-services | ||
|
||
go 1.20 | ||
go 1.21 | ||
|
||
require ( | ||
github.com/google/uuid v1.3.1 | ||
|
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