From 323c2a4538bc9e33be1202fd911acc7b72541dea Mon Sep 17 00:00:00 2001 From: Michael Kaiser Date: Tue, 25 Jun 2024 22:59:05 +0200 Subject: [PATCH] adding first dockerfiles and updating gitignore --- .dockerignore | 41 ++++++++++++++++++++++++++++++ .gitignore | 18 +++++++++++++ docker/frontend/admin/Dockerfile | 43 ++++++++++++++++++++++++++++++++ docker/frontend/user/Dockerfile | 40 +++++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 .dockerignore create mode 100644 docker/frontend/admin/Dockerfile create mode 100644 docker/frontend/user/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2ea2dee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,41 @@ +# CodeGrader - https://github.com/ooemperor/CodeGrader +# Copyright © 2023, 2024 Michael Kaiser +# +# This file is part of CodeGrader. +# +# CodeGrader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# CodeGrader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with CodeGrader. If not, see . + + +# dockerignore File +# specifies files that shall be ignored by the docker build process +.git +.gitignore +.gitattributes + +__pycache__ +*.pyc +*.pyo +*.pyd +.Python +env + +doc/ +doc/* +tests/ +tests/* +services/ +services/* + +*.sec.json +*.sec.conf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2ea33a8..81ceb36 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,21 @@ +# CodeGrader - https://github.com/ooemperor/CodeGrader +# Copyright © 2023, 2024 Michael Kaiser +# +# This file is part of CodeGrader. +# +# CodeGrader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# CodeGrader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with CodeGrader. If not, see . + #gitignore for automatic code Grader # Ignore all python venv *venv* diff --git a/docker/frontend/admin/Dockerfile b/docker/frontend/admin/Dockerfile new file mode 100644 index 0000000..dc98c70 --- /dev/null +++ b/docker/frontend/admin/Dockerfile @@ -0,0 +1,43 @@ +# CodeGrader - https://github.com/ooemperor/CodeGrader +# Copyright © 2023, 2024 Michael Kaiser +# +# This file is part of CodeGrader. +# +# CodeGrader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# CodeGrader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with CodeGrader. If not, see . + +# specify base image +FROM python:3.10-bookworm + +# specify WORKDIR +WORKDIR /app + +# COPY and install the requirements +RUN apt-get -y update +RUN apt-get -y upgrade +RUN pip install --upgrade pip + +COPY codeGrader /app/codeGrader +RUN pip install -r /app/codeGrader/frontend/requirements.txt + +COPY setup_frontend.py /app/setup.py + +# install the application +RUN python3 -m pip install . + +# remove src files +RUN rm -r /app/codeGrader +RUN rm -r /app/setup.py + +# Start Command for admin frontend +CMD ["cgAdminFrontend"] \ No newline at end of file diff --git a/docker/frontend/user/Dockerfile b/docker/frontend/user/Dockerfile new file mode 100644 index 0000000..d281f74 --- /dev/null +++ b/docker/frontend/user/Dockerfile @@ -0,0 +1,40 @@ +# This file is part of CodeGrader. +# +# CodeGrader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# CodeGrader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with CodeGrader. If not, see . + +# specify base image +FROM python:3.10-bookworm + +# specify WORKDIR +WORKDIR /app + +# COPY and install the requirements +RUN apt-get -y update +RUN apt-get -y upgrade +RUN pip install --upgrade pip + +COPY codeGrader /app/codeGrader +RUN pip install -r /app/codeGrader/frontend/requirements.txt + +COPY setup_frontend.py /app/setup.py + +# install the application +RUN python3 -m pip install . + +# remove src files +RUN rm -r /app/codeGrader +RUN rm -r /app/setup.py + +# Start Command for admin frontend +CMD ["cgUserFrontend"] \ No newline at end of file