-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(produktion): Implementiere Docker-basierte Produktionsumgebung
- 🐳 Erstelle Dockerfile zur Containerisierung - 🚀 Richte automatischen Build und Push zu DockerHub ein - 📄 Entwickle docker-compose.yml für einfache Bereitstellung - 🔧 Ersetze hartcodierte Pfade durch API-Aufrufe zur Vermeidung von CORS-Problemen - 🏠 Vereinfache Self-Hosting-Prozess durch Konfiguration mit einer einzigen URL - 🖥️ Passe server.js an neue Produktionsstruktur an - 🐛 Behebe Fehler, die durch Übergang zur Produktionsumgebung entstanden sind Dieser Commit markiert den **Übergang von der Entwicklungs- zu einer robusten, containerisierten Produktionsumgebung**. Er verbessert die Bereitstellbarkeit und reduziert die Konfigurationskomplexität für Endbenutzer.
- Loading branch information
Simon Luthe
authored and
Simon Luthe
committed
Jul 25, 2024
1 parent
35d2b5b
commit d60ffcb
Showing
13 changed files
with
888 additions
and
350 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
.git | ||
.gitignore |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Docker | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag hymnoscripe:$(date +%s) | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: revisoren | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Push to Docker Hub | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: revisoren/hymnoscripe:latest |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM node:22 as build | ||
|
||
WORKDIR /app | ||
|
||
# Kopieren und Installieren der Backend-Abhängigkeiten | ||
COPY backend/package*.json ./backend/ | ||
RUN cd backend && npm install | ||
|
||
# Kopieren und Bauen des Frontends | ||
COPY frontend ./frontend | ||
|
||
# Kopieren der Backend-Dateien | ||
COPY backend ./backend | ||
|
||
# Kopieren der Konfigurationsdateien | ||
COPY init.sql ./ | ||
|
||
FROM node:22-slim | ||
|
||
WORKDIR /app | ||
|
||
# Kopieren der gebauten Anwendung aus dem Build-Stage | ||
COPY --from=build /app/backend ./backend | ||
COPY --from=build /app/frontend ./frontend | ||
COPY --from=build /app/init.sql ./ | ||
|
||
WORKDIR /app/backend | ||
RUN npm install --only=production | ||
|
||
EXPOSE 9615 | ||
|
||
CMD ["node", "backend/server.js"] |
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.