-
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
36 changed files
with
114 additions
and
155 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
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,23 +1,27 @@ | ||
FROM golang:latest as build | ||
|
||
COPY . /oj-lab-platform-build | ||
WORKDIR /workdir | ||
|
||
COPY . /workdir | ||
|
||
WORKDIR /oj-lab-platform-build | ||
RUN apt update && apt install -y make zip curl | ||
RUN make build | ||
RUN ./scripts/update-frontend-dist.sh /oj-lab-platform-build/frontend_dist | ||
RUN make get-front | ||
|
||
|
||
FROM ubuntu:latest | ||
|
||
WORKDIR /workdir | ||
WORKDIR /oj-lab-platform | ||
|
||
COPY --from=build /workdir/bin/web_server /usr/local/bin/web_server | ||
COPY --from=build /workdir/frontend/dist ./frontend_dist | ||
|
||
COPY --from=build /oj-lab-platform-build/bin/web_server /usr/local/bin/web_server | ||
COPY --from=build /oj-lab-platform-build/frontend_dist /workdir/frontend_dist | ||
COPY config.toml ./config.toml | ||
|
||
COPY workdirs/docker/config.toml /workdir/config.toml | ||
ENV OJ_LAB_SERVICE_ENV='production' | ||
ENV DATABASE_DSN='user=postgres password=postgres host=host.docker.internal port=5432 dbname=oj_lab sslmode=disable TimeZone=Asia/Shanghai' | ||
ENV REDIS_HOSTS='["host.docker.internal:6379"]' | ||
ENV MINIO_ENDPOINT='http://host.docker.internal:9000' | ||
|
||
ENV OJ_LAB_SERVICE_ENV=production | ||
ENV OJ_LAB_WORKDIR=/workdir | ||
EXPOSE 8080 | ||
CMD [ "web_server" ] |
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
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
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
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
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
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
Oops, something went wrong.