From d4a10e6d5a91bf02abeefea616984bbe5ef1aeac Mon Sep 17 00:00:00 2001
From: Tobias Mieves <tobias.mieves@tu-dortmund.de>
Date: Sun, 7 Apr 2024 20:59:22 +0200
Subject: [PATCH] build: Optimize docker file

---
 .gitlab-ci.yml          |  1 +
 .onedev-buildspec.yml   | 37 -------------------------------------
 .pre-commit-config.yaml | 25 -------------------------
 Dockerfile              |  7 ++-----
 README.md               |  4 ++--
 docker-compose.yml      |  3 ++-
 6 files changed, 7 insertions(+), 70 deletions(-)
 delete mode 100644 .onedev-buildspec.yml
 delete mode 100644 .pre-commit-config.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 27beb8d..3d13c00 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,4 @@
+---
 include:
   - project: tobiasff3200/ci-cd
     file: .gitlab-ci.yml
diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml
deleted file mode 100644
index 3175e82..0000000
--- a/.onedev-buildspec.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-version: 25
-jobs:
-  - name: Git Sync Push
-    steps:
-      - !PushRepository
-        name: Push to gitlab.fachschaften.org
-        remoteUrl: https://gitlab.fachschaften.org/tobiasff3200/wishlist.git
-        userName: Tobias
-        passwordSecret: GitLab.Fachschaften.org_Sync_Token
-        force: false
-        condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
-    triggers:
-      - !BranchUpdateTrigger { }
-      - !TagCreateTrigger { }
-    retryCondition: never
-    maxRetries: 3
-    retryDelay: 30
-    timeout: 3600
-  - name: Git Sync Pull
-    steps:
-      - !PullRepository
-        name: Pull from gitlab.fachschaften.org
-        remoteUrl: https://gitlab.fachschaften.org/tobiasff3200/wishlist.git
-        syncToChildProject: false
-        userName: Tobias
-        passwordSecret: GitLab.Fachschaften.org_Sync_Token
-        refs: refs/heads/* refs/tags/*
-        withLfs: true
-        force: false
-        condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL
-    triggers:
-      - !ScheduleTrigger
-        cronExpression: 5 4 * * * ?
-    retryCondition: never
-    maxRetries: 3
-    retryDelay: 30
-    timeout: 3600
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
deleted file mode 100644
index 67893f2..0000000
--- a/.pre-commit-config.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-repos:
-  - repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.2.0
-    hooks:
-      - id: check-ast
-      - id: check-json
-      - id: check-yaml
-      - id: detect-private-key
-      - id: pretty-format-json
-        args: [ --autofix ]
-      - id: requirements-txt-fixer
-#  - repo: https://github.com/pre-commit/mirrors-eslint
-#    rev: "v8.15.0"
-#    hooks:
-#      - id: eslint
-
-  #  - repo: https://github.com/pre-commit/mirrors-mypy
-  #    rev: "v0.950"
-  #    hooks:
-  #      - id: mypy
-
-  - repo: https://github.com/psf/black
-    rev: 22.3.0
-    hooks:
-      - id: black
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 57d1dae..857f7e6 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,16 +1,13 @@
 FROM registry.gitlab.fachschaften.org/tobiasff3200/django-core:v3.0.0 as core
 WORKDIR /app
 COPY . /app/wishlist
-RUN pip install --no-cache-dir -r wishlist/requirements.txt && rm wishlist/requirements.txt
-
-RUN sed -i 's/{{app_to_install}}/wishlist/g' core/settings.py && sed -i 's/{{app_to_install}}/wishlist/g' core/urls.py
+RUN pip install --no-cache-dir -r wishlist/requirements.txt && rm wishlist/requirements.txt && sed -i 's/{{app_to_install}}/wishlist/g' core/settings.py && sed -i 's/{{app_to_install}}/wishlist/g' core/urls.py
 
 
 FROM node:21 AS node
 WORKDIR /app/wishlist
 COPY --from=core /app /app
-RUN npm ci
-RUN npm run tailwind
+RUN npm ci && npm run tailwind
 
 
 FROM core
diff --git a/README.md b/README.md
index fdd3bc9..7b56af1 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # Wunschliste
 
-## Features:
+## Features
 
 - Eine Wunschliste für Jeden
 - Es können versteckte Wünsche zu den Listen der anderen hinzufügen werden.
@@ -59,4 +59,4 @@ Gerne können auch Änderungswünsche oder neue Funktionen vorgeschlagen werden.
 
 ## Credits
 
-[Wishlist icons created by Freepik - Flaticon](https://www.flaticon.com/free-icons/wishlist)
\ No newline at end of file
+[Wishlist icons created by Freepik - Flaticon](https://www.flaticon.com/free-icons/wishlist)
diff --git a/docker-compose.yml b/docker-compose.yml
index 7abe624..9fefe53 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,3 +1,4 @@
+---
 version: "3"
 services:
   wishlist:
@@ -12,4 +13,4 @@ services:
     volumes:
       - ./wishlist-db/:/app/db/
     environment:
-      - DEBUG=True
\ No newline at end of file
+      - DEBUG=True
-- 
GitLab