Compare commits

...

19 Commits

Author SHA1 Message Date
4a69a4f8a3 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 23s
2024-11-29 12:45:56 +00:00
810c70eb9a Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 30s
2024-10-11 08:11:26 +00:00
b664d39a04 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 26s
2024-09-26 18:54:25 +00:00
956eda1018 entrypoint.sh aktualisiert 2024-09-26 18:53:44 +00:00
150ae93fe7 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 27s
2024-09-26 13:13:01 +00:00
e640923835 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 22s
2024-09-26 13:08:20 +00:00
aefc4b01f3 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 21s
2024-09-26 12:59:26 +00:00
2e31fb067e .gitea/workflows/build.yml aktualisiert 2024-09-26 12:58:22 +00:00
d25dcc903f Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 15s
2024-09-26 12:40:54 +00:00
c423b2b801 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 31s
2024-09-26 12:32:28 +00:00
0a676b3f9d Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 15s
2024-09-26 12:25:19 +00:00
0d60d53f9f Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 15s
2024-09-26 12:21:26 +00:00
ba3cf572a0 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 31s
2024-09-26 12:15:22 +00:00
57871c9045 entrypoint.sh aktualisiert 2024-09-26 12:15:00 +00:00
a573b22911 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 27s
2024-09-26 12:02:29 +00:00
27419ee314 entrypoint.sh aktualisiert 2024-09-26 12:01:45 +00:00
07e602dee7 Dockerfile aktualisiert
All checks were successful
Create postgresql docker image / Explore-Gitea-Actions (push) Successful in 27s
2024-09-26 11:43:37 +00:00
75d2aee0db .gitea/workflows/build_nopush.yml aktualisiert 2024-09-26 11:43:23 +00:00
e9b17261c5 Dockerfile aktualisiert 2024-09-26 11:42:30 +00:00
3 changed files with 12 additions and 4 deletions

View File

@ -3,7 +3,7 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
branches: branches:
- devel - main
paths: paths:
- "Dockerfile" - "Dockerfile"

View File

@ -1,12 +1,15 @@
FROM alpine:latest FROM alpine:latest
LABEL maintainer="development@cooltux.net" LABEL maintainer="development@cooltux.net"
ARG VERSION=16-20240926.1 ARG VERSION=16-20241129
# PostgreSQL-Client installieren # PostgreSQL-Client installieren
RUN apk update --no-cache ; \ RUN apk update --no-cache ; \
apk add --no-cache postgresql16-client apk add --no-cache postgresql16-client
# Erstelle einen Benutzer mit UID 26
RUN adduser -u 1000 -D -S backupuser
# Arbeitsverzeichnis erstellen # Arbeitsverzeichnis erstellen
WORKDIR /backup WORKDIR /backup
@ -16,5 +19,8 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# Skript ausführbar machen # Skript ausführbar machen
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh
# Wechsle den Benutzer auf den erstellten Benutzer mit UID 26
USER 1000
# Festlegen des EntryPoints für das Docker-Image # Festlegen des EntryPoints für das Docker-Image
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@ -13,7 +13,7 @@ echo "$PGHOST:5432:$PGDATABASE:$PGUSER:$PGPASSWORD" > ~/.pgpass
chmod 600 ~/.pgpass chmod 600 ~/.pgpass
# Optional: Standardwert für den Dateinamen der Sicherung # Optional: Standardwert für den Dateinamen der Sicherung
BACKUP_FILE=${BACKUP_FILE:-"/backup/$PGDATABASE_$(date +%Y%m%d_%H%M%S).sql"} BACKUP_FILE=${BACKUP_FILE:-"/backup/$(echo $PGDATABASE)DB_$(date +%d-%m-%Y).sql"}
# Führe den pg_dump-Befehl aus (pg_dump wird automatisch die .pgpass-Datei verwenden) # Führe den pg_dump-Befehl aus (pg_dump wird automatisch die .pgpass-Datei verwenden)
pg_dump -h "$PGHOST" -U "$PGUSER" -d "$PGDATABASE" -F c -f "$BACKUP_FILE" pg_dump -h "$PGHOST" -U "$PGUSER" -d "$PGDATABASE" -F c -f "$BACKUP_FILE"
@ -24,4 +24,6 @@ if [ $? -eq 0 ]; then
else else
echo "Fehler bei der Sicherung der Datenbank" echo "Fehler bei der Sicherung der Datenbank"
exit 1 exit 1
fi fi
exit 0