You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: www/src/pages/de/deployment/docker.md
+44-44
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
---
2
2
title: Docker
3
-
description: Deployment with Docker
3
+
description: Bereitstellung mit Docker
4
4
layout: ../../../layouts/docs.astro
5
-
lang: en
5
+
lang: de
6
6
---
7
7
8
-
You can containerize this stack and deploy it as a single container using Docker, or as a part of a group of containers using docker-compose. See [`ajcwebdev/ct3a-docker`](https://github.com/ajcwebdev/ct3a-docker)for an example repo based on this doc.
8
+
Der Stack kann mit Docker bereitgestellt werden. Entweder als einzelner Container oder als Gruppe von Containern mit `docker-compose`. Ein Beispiel lässt sich in dem Repository [`ajcwebdev/ct3a-docker`](https://github.com/ajcwebdev/ct3a-docker)finden, welches auf dieser Dokumentation basiert.
9
9
10
-
## Docker Project Configuration
10
+
## Docker Projekt Konfiguration
11
11
12
-
Please note that Next.js requires a different process for build time (available in the frontend, prefixed by`NEXT_PUBLIC`) and runtime environment, server-side only, variables. In this demo we are using two variables, pay attention to their positions in the `Dockerfile`, command-line arguments, and `docker-compose.yml`:
12
+
Next.js benötigt unterschiedliche Vorgehensweisen für Variablen, die zur "Build time" gesetzt werden (verfügbar im Frontend, gepräfixt durch`NEXT_PUBLIC`) und Variablen, die nur serverseitig verfügbar sein sollen. Bitte beachte also die Anordnung der Variablen in der Befehlszeile, der `Dockerfile` und der `docker-compose.yml` Datei.
13
13
14
-
-`DATABASE_URL` (used by the server)
15
-
-`NEXT_PUBLIC_CLIENTVAR` (used by the client)
14
+
-`DATABASE_URL` (wird vom Server verwendet)
15
+
-`NEXT_PUBLIC_CLIENTVAR` (wird vom Client verwendet)
16
16
17
-
### 1. Next Configuration
17
+
### 1. Next.js Konfiguration
18
18
19
-
In your[`next.config.mjs`](https://github.com/t3-oss/create-t3-app/blob/main/cli/template/base/next.config.mjs), add the `standalone`output-option configuration to [reduce image size by automatically leveraging output traces](https://nextjs.org/docs/advanced-features/output-file-tracing):
19
+
In der[`next.config.mjs`](https://github.com/t3-oss/create-t3-app/blob/main/cli/template/base/next.config.mjs), muss die output-Option auf `standalone`gesetzt werden, um die Größe vom Docker-Image zu reduzieren und Gebrauch von ["Output File Tracing"](https://nextjs.org/docs/advanced-features/output-file-tracing) zu machen:
Click here and include contents in <code>.dockerignore</code>:
33
+
Klick hier und kopiere den Inhalt in <code>.dockerignore</code>:
34
34
</summary>
35
35
<divclass="content">
36
36
@@ -49,28 +49,28 @@ README.md
49
49
50
50
</details>
51
51
52
-
### 3. Create Dockerfile
52
+
### 3. Dockerfile erstellen
53
53
54
-
> Since we're not pulling the server environment variables into our container, the [environment schema validation](/en/usage/env-variables)will fail. To prevent this, we have to add a `SKIP_ENV_VALIDATION=1`flag to the build command so that the env-schemas aren't validated at build time.
54
+
> Da wir die Umgebungsvariablen des Servers nicht in den Container ziehen, wird die [Validierung der Umgebungsvariablen](/de/usage/env-variables)fehlschlagen. Um dies zu verhindern, müssen wir dem Build-Befehl `SKIP_ENV_VALIDATION=1`hinzufügen, damit die Umgebungsvariablen-Schemas nicht zur "Build time" validiert werden.
55
55
56
56
<details>
57
57
<summary>
58
-
Click here and include contents in <code>Dockerfile</code>:
58
+
Klick hier und kopiere den Inhalt in <code>Dockerfile</code>:
59
59
</summary>
60
60
<divclass="content">
61
61
62
62
```docker
63
-
##### DEPENDENCIES
63
+
##### Abhängigkeiten
64
64
65
65
FROM --platform=linux/amd64 node:16-alpine AS deps
66
66
RUN apk add --no-cache libc6-compat openssl
67
67
WORKDIR /app
68
68
69
-
# Install Prisma Client - remove if not using Prisma
69
+
# Installiere Prisma Client - Entferne diese Zeile wenn du Prisma nicht verwendest
70
70
71
71
COPY prisma ./
72
72
73
-
# Install dependencies based on the preferred package manager
73
+
# Installiere die Abhängigkeiten basierend auf dem bevorzugten Paketmanager
> -_Emulation of`--platform=linux/amd64`may not be necessary after moving to Node 18._
132
-
> -_See[`node:alpine`](https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine)to understand why `libc6-compat`might be needed._
133
-
> -_Next.js collects [anonymous telemetry data about general usage](https://nextjs.org/telemetry). Uncomment the first instance of `ENV NEXT_TELEMETRY_DISABLED 1` to disable telemetry during the build. Uncomment the second instance to disable telemetry during runtime._
131
+
> -_Emulation von`--platform=linux/amd64`ist gegebenfalls nicht mehr notwendig mit Node 18._
132
+
> -_Siehe[`node:alpine`](https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine)um zu verstehen warum `libc6-compat`eventuell benötigt wird._
133
+
> -_Next.js erfasst [anonyme Daten zur Nutzung](https://nextjs.org/telemetry). In der obenstehenden `Dockerfile` befinden sich bereits zwei auskommentierte Zeilen mit dem Befehl `ENV NEXT_TELEMETRY_DISABLED 1`. Entferne die Kommentare der ersten Zeile um die Datenerfassung während des Builds zu deaktivieren. Die zweite Zeile deaktiviert die Datenerfassung zur Laufzeit._
134
134
135
135
</div>
136
136
</details>
137
137
138
-
## Build and Run Image Locally
138
+
## Erstellung und lokale Ausführung des Images
139
139
140
-
Build and run this image locally with the following commands:
140
+
Erstelle und starte das Image lokal mit folgenden Befehlen:
docker run -p 3000:3000 -e DATABASE_URL="database_url_goes_here" ct3a-docker
144
+
docker run -p 3000:3000 -e DATABASE_URL="hier_datenbank_url_einfügen" ct3a-docker
145
145
```
146
146
147
-
Open[localhost:3000](http://localhost:3000/)to see your running application.
147
+
Öffne[localhost:3000](http://localhost:3000/)um die laufende Anwendung zu sehen.
148
148
149
149
## Docker Compose
150
150
151
-
You can also use Docker Compose to build the image and run the container.
151
+
Du kannst auch Docker Compose verwenden, um deine Anwendung zu starten.
152
152
153
153
<details>
154
154
<summary>
155
-
Follow steps 1-4 above, click here, and include contents in <code>docker-compose.yml</code>:
155
+
Verfolge die obenstehenden Schritte 1-4, klicke hier und füge den Inhalt in <code>docker-compose.yml</code> ein:
156
156
</summary>
157
157
<divclass="content">
158
158
@@ -171,23 +171,23 @@ services:
171
171
- "3000:3000"
172
172
image: t3-app
173
173
environment:
174
-
- DATABASE_URL=database_url_goes_here
174
+
- DATABASE_URL=hier_datenbank_url_einfügen
175
175
```
176
176
177
-
Run this using the `docker compose up` command:
177
+
Führe den Befehl `docker compose up` aus:
178
178
179
179
```bash
180
180
docker compose up
181
181
```
182
182
183
-
Open [localhost:3000](http://localhost:3000/) to see your running application.
183
+
Öffne [localhost:3000](http://localhost:3000/) um die laufende Anwendung zu sehen.
184
184
185
185
</div>
186
186
</details>
187
187
188
-
## Deploy to Railway
188
+
## Deploy nach Railway
189
189
190
-
You can use a PaaS such as [Railway's](https://railway.app) automated [Dockerfile deployments](https://docs.railway.app/deploy/dockerfiles) to deploy your app. If you have the [Railway CLI installed](https://docs.railway.app/develop/cli#install) you can deploy your app with the following commands:
190
+
Du kannst einen PaaS wie [Railway's](https://railway.app) automatisierte [Dockerfile deployments](https://docs.railway.app/deploy/dockerfiles) verwenden um deine Anwendung zu deployen. Wenn du die [Railway CLI installiert hast](https://docs.railway.app/develop/cli#install) kannst du deine Anwendung mit folgenden Befehlen deployen:
191
191
192
192
```bash
193
193
railway login
@@ -197,17 +197,17 @@ railway up
197
197
railway open
198
198
```
199
199
200
-
Go to "Variables" and include your `DATABASE_URL`. Then go to "Settings" and select "Generate Domain." To view a running example on Railway, visit [ct3a-docker.up.railway.app](https://ct3a-docker.up.railway.app/).
200
+
Gehe zu "Variables" und füge deine `DATABASE_URL` ein. Anschließend gehe zu "Settings" und wähle "Generate Domain". Um ein laufendes Beispiel auf Railway zu sehen, besuche [ct3a-docker.up.railway.app](https://ct3a-docker.up.railway.app/).
0 commit comments