Skip to content

Commit

Permalink
Optimize docker image creation
Browse files Browse the repository at this point in the history
  • Loading branch information
mraron committed Jun 24, 2024
1 parent 2364ac3 commit 537876e
Show file tree
Hide file tree
Showing 2,169 changed files with 25 additions and 61,437 deletions.
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
FROM ubuntu:22.04
FROM golang:1.22.4-bookworm

WORKDIR /app

COPY go.mod ./
COPY go.sum ./

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Budapest
RUN apt-get update && apt-get install -y wget ca-certificates openjdk-8-jdk mono-mcs fpc tzdata cython3 golang pandoc gccgo pypy3 python3-dev g++ gcc build-essential
RUN apt-get update && apt-get install -y pandoc

COPY go.mod ./
COPY go.sum ./
RUN go mod download && go install github.com/go-delve/delve/cmd/dlv@latest
COPY --from=golang:1.22 /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:${PATH}"

COPY static/ ./static
COPY cmd/ ./cmd
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ services:
env_file:
- web.env
volumes:
- type: volume
source: problems
- type: bind
source: /home/aron/Projects/njudge/njudge_problems_git
target: /njudge_problems
networks:
- default
Expand All @@ -29,8 +29,8 @@ services:
env_file:
- judge.env
volumes:
- type: volume
source: problems
- type: bind
source: /home/aron/Projects/njudge/njudge_problems_git
target: /njudge_problems
networks:
- default
Expand Down
6 changes: 5 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function bootstrapIcons() {
return src('node_modules/bootstrap-icons/**/*').pipe(dest('static/bootstrap-icons'))
}

function selectCSS() {
return src('node_modules/select2/dist/css/select2.min.css').pipe(dest('static/css'))
}

function selectJS() {
return src('node_modules/select2/dist/js/select2.min.js', {sourcemaps: true}).pipe(dest('static/js', {sourcemaps: '.'}))
}
Expand All @@ -58,6 +62,6 @@ function popperJS() {
}

const admin = parallel(adminCSS, adminJS)
const main = parallel(mainCSS, mainJS, mainFavicon, bootstrapJS, selectJS, jqueryJS, katex, bootstrapIcons, popperJS)
const main = parallel(mainCSS, mainJS, mainFavicon, bootstrapJS, selectCSS, selectJS, jqueryJS, katex, bootstrapIcons, popperJS)

exports.default = parallel(admin, main)
4 changes: 2 additions & 2 deletions judge.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG PROJECT_NAME

FROM ubuntu:22.04 as judge_deps
FROM debian:bookworm as judge_deps
RUN apt-get update && apt-get install -y wget gcc g++ git build-essential libcap-dev
WORKDIR /app
RUN git clone --depth 1 --branch v1.10.1 https://github.com/ioi/isolate.git
Expand All @@ -9,6 +9,7 @@ RUN make isolate

FROM ${PROJECT_NAME}-base

RUN apt-get update && apt-get install -y openjdk-17-jdk mono-mcs fpc cython3 golang pandoc gccgo pypy3 python3-dev g++ gcc
COPY --from=judge_deps /app/isolate /app/isolate
WORKDIR /app/isolate
RUN make install
Expand All @@ -19,5 +20,4 @@ RUN ln -s /usr/local/julia/bin/julia /usr/local/bin/julia

WORKDIR /app
COPY configs/docker/judge.yaml ./judge.yaml

CMD ["./njudge", "judge"]
Binary file removed static/android-chrome-192x192.png
Binary file not shown.
Binary file removed static/android-chrome-512x512.png
Binary file not shown.
Binary file removed static/apple-touch-icon.png
Binary file not shown.
21 changes: 0 additions & 21 deletions static/bootstrap-icons/LICENSE

This file was deleted.

100 changes: 0 additions & 100 deletions static/bootstrap-icons/README.md

This file was deleted.

1 change: 0 additions & 1 deletion static/bootstrap-icons/bootstrap-icons.svg

This file was deleted.

Loading

0 comments on commit 537876e

Please sign in to comment.