Use the published Docker image in Compose
All checks were successful
Docker-Image veröffentlichen / publish (push) Successful in 49s
All checks were successful
Docker-Image veröffentlichen / publish (push) Successful in 49s
This commit is contained in:
parent
27924e55e9
commit
6253406d31
@ -20,12 +20,12 @@ Selbst gehostete Linksammlungen mit einer öffentlichen Seite pro Abteilung. Die
|
||||
3. Kopiere die vollständige Ausgabe einschließlich `scrypt:` in `ADMIN_PASSWORD_HASH` in deiner `.env`. Starte die App.
|
||||
|
||||
```sh
|
||||
docker compose up -d --build
|
||||
docker compose up -d --pull always
|
||||
```
|
||||
|
||||
4. Öffne [http://localhost:8090](http://localhost:8090), melde dich an und lege eine Abteilung an. Deren öffentlicher Pfad lautet beispielsweise `/it`.
|
||||
|
||||
Die App bindet standardmäßig an `127.0.0.1`. `BIND_ADDRESS` und `HTTP_PORT` steuern die Veröffentlichung des Container-Ports. Für den Zugriff über einen HTTPS-Reverse-Proxy leite den Verkehr an Port 8090 weiter und setze `COOKIE_SECURE=true`. Nach Änderungen an der Laufzeitkonfiguration übernimmt `docker compose up -d` die neuen Werte.
|
||||
Die App bindet standardmäßig an `127.0.0.1`. `BIND_ADDRESS` und `HTTP_PORT` steuern die Veröffentlichung des Container-Ports. Für den Zugriff über einen HTTPS-Reverse-Proxy leite den Verkehr an Port 8090 weiter und setze `COOKIE_SECURE=true`. Nach Änderungen an der Laufzeitkonfiguration übernimmt `docker compose up -d` die neuen Werte. Mit `--pull always` holt Compose den aktuellen Stand von `latest`.
|
||||
|
||||
Das Compose-Volume `links-data` enthält die SQLite-Datenbank samt Icons. `docker compose restart` und `docker compose down` erhalten das Volume. `docker compose down --volumes` löscht es. Für eine konsistente Dateisicherung stoppe den Container vor dem Kopieren des Volumes. Admin-Sitzungen laufen nach zwölf Stunden ab und enden beim Container-Neustart.
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
services:
|
||||
links:
|
||||
build: .
|
||||
image: git.jfritzsche.de/jf/syncova-links:latest
|
||||
init: true
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
||||
@ -39,7 +39,7 @@ function run(command, args) {
|
||||
})
|
||||
}
|
||||
|
||||
const compose = ['compose', '--env-file', envFile, '-p', project, '-f', 'compose.yaml']
|
||||
const compose = ['compose', '--env-file', envFile, '-p', project, '-f', 'compose.yaml', '-f', 'tests/compose.build.yaml']
|
||||
await writeFile(envFile, Object.entries(runtime).map(([key, value]) => key + '=' + value).join('\n') + '\n', {
|
||||
flag: 'wx', mode: 0o600,
|
||||
})
|
||||
@ -51,7 +51,7 @@ try {
|
||||
process.exitCode = 1
|
||||
await run('docker', [...compose, 'logs', '--tail', '40']).catch(() => {})
|
||||
} finally {
|
||||
await run('docker', [...compose, 'down', '--volumes', '--rmi', 'local']).catch((error) => {
|
||||
await run('docker', [...compose, 'down', '--volumes', '--rmi', 'all']).catch((error) => {
|
||||
console.error(error.message)
|
||||
process.exitCode = 1
|
||||
})
|
||||
|
||||
@ -216,7 +216,8 @@ test('Frischer Docker-Start, Verwaltung und persistente öffentliche Ansicht', a
|
||||
})
|
||||
|
||||
await test.step('Neustart aus demselben Volume', async () => {
|
||||
await exec('docker', ['compose', '--env-file', envFile, '-p', project, '-f', 'compose.yaml', 'restart', 'links'], { timeout: 25_000 })
|
||||
await exec('docker', ['compose', '--env-file', envFile, '-p', project,
|
||||
'-f', 'compose.yaml', '-f', 'tests/compose.build.yaml', 'restart', 'links'], { timeout: 25_000 })
|
||||
await expect.poll(async () => (await fetch(baseURL + '/healthz').catch(() => null))?.status).toBe(200)
|
||||
await publicPage.goto('/it')
|
||||
await publicLayout('Kacheln')
|
||||
|
||||
5
tests/compose.build.yaml
Normal file
5
tests/compose.build.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
services:
|
||||
links:
|
||||
image: ${COMPOSE_PROJECT_NAME}-links:test
|
||||
build: .
|
||||
pull_policy: build
|
||||
Loading…
Reference in New Issue
Block a user