Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Docker image #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set the base image. We cannot use alpine as long as we don't get rid of
# Set the base image. We cannot use alpine as long as we don't get rid of
# therubyracer.
FROM ruby:2.7.2-slim
FROM ruby:3.1.2-slim

# Tag the repository.
LABEL org.opencontainers.image.source https://github.com/dodona-edu/dodona
Expand All @@ -11,12 +11,17 @@ LABEL org.opencontainers.image.source https://github.com/dodona-edu/dodona

# Install system packages.
RUN apt-get update
RUN apt-get -y install --no-install-recommends \
build-essential curl git libmariadb-dev
RUN apt-get -y install --no-install-recommends \
build-essential ca-certificates curl git gnupg libmariadb-dev

# Install NodeJS.
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
RUN apt-get -y install --no-install-recommends nodejs
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=20
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | \
tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get -y install --no-install-recommends nodejs
RUN npm install -g yarn

# Install common ruby packages to leverage docker caching.
Expand Down Expand Up @@ -58,6 +63,9 @@ RUN sed -i '[email protected]:dodona-edu/+https://github.com/dodona-edu/+g' \
RUN sed -i 's/judge-pythia.git/judge-java12.git/' /app/db/seeds.rb
RUN sed -i 's/20\.times/2.times/g' /app/db/seeds.rb

RUN yarn build:js
RUN yarn build:css

# Set the initialisation script.
RUN chmod +x /app/docker-entrypoint.sh
ENTRYPOINT /app/docker-entrypoint.sh
Expand All @@ -70,4 +78,4 @@ EXPOSE 3000
################################################################################

# Remove build dependencies.
RUN apt-get purge -y --auto-remove build-essential
RUN apt-get purge -y --auto-remove build-essential
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Dodona docker image

This repository contains the files to create a Dodona docker image. A nightly version is published every night based on the develop branch of the main Dodona repo.

## Usage

```bash
git clone https://github.com/dodona-edu/dodona
git clone https://github.com/dodona-edu/docker-image
cp docker-image/* dodona/
cd dodona/
docker-compose up -d
```
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
interval: 5s
timeout: 1m
retries: 12
volumes:
- data:/var/lib/mysql
ports:
- "3306:3306"

Expand All @@ -20,5 +22,10 @@ services:
build: .
depends_on:
- database
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "3000:3000"
- "3000:3000"

volumes:
data: