Skip to content

Commit 46983db

Browse files
Review getting started's container image (#270)
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
1 parent 3420abd commit 46983db

4 files changed

Lines changed: 36 additions & 23 deletions

File tree

content/en/docs/get started/_index.md

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ To begin, follow the [installation instructions](/docs/score-implementation/scor
1919

2020
## 2. `score.yaml`
2121

22-
Open your IDE and paste in the following `score.yaml` file, which describes a simple web server that queries a PostgreSQL database on each request and is exposed via a DNS. The demo code can be found [here](https://github.com/score-spec/sample-app-gif/blob/main/score.yaml).
22+
Open your IDE and paste in the following `score.yaml` file, which describes a simple web server that queries a PostgreSQL database on each request and is exposed via a DNS. The demo code can be found [here](https://github.com/score-spec/sample-score-app/blob/main/score.yaml).
2323

2424
```yaml
2525
apiVersion: score.dev/v1b1
2626
metadata:
27-
name: sample
27+
name: hello-world
28+
annotations:
29+
tags: "nodejs,http,website,javascript,postgres"
2830
containers:
29-
main:
31+
hello-world:
3032
image: .
3133
variables:
32-
PG_CONNECTION_STRING: "postgresql://${resources.db.username}:${resources.db.password}@${resources.db.host}:${resources.db.port}/${resources.db.database}?sslmode=disable"
33-
service:
34-
ports:
35-
web:
36-
port: 8080
34+
PORT: "3000"
35+
MESSAGE: "Hello, World!"
36+
DB_DATABASE: ${resources.db.name}
37+
DB_USER: ${resources.db.username}
38+
DB_PASSWORD: ${resources.db.password}
39+
DB_HOST: ${resources.db.host}
40+
DB_PORT: ${resources.db.port}
3741
resources:
3842
db:
3943
type: postgres
@@ -45,6 +49,11 @@ resources:
4549
host: ${resources.dns.host}
4650
path: /
4751
port: 8080
52+
service:
53+
ports:
54+
www:
55+
port: 8080
56+
targetPort: 3000
4857
```
4958
5059
## 3. `score-compose init`
@@ -62,7 +71,7 @@ The `init` command will create the `.score-compose` directory with the [default
6271
Convert the `score.yaml` file into a deployable `compose.yaml`, run the following command in your terminal:
6372

6473
```bash
65-
score-compose generate score.yaml --image ghcr.io/score-spec/sample-app-gif:main
74+
score-compose generate score.yaml --image scorespec/sample-score-app:main
6675
```
6776

6877
The `generate` command will add the input `score.yaml` workload with a particular container image to the `.score-compose/state.yaml` state file and generate the output `compose.yaml`.
@@ -82,12 +91,14 @@ docker compose up -d
8291
```
8392

8493
```none
85-
[+] Running 5/5
86-
✔ Container test-routing-avhAWY-1 Running
87-
✔ Container test-pg-t3Fg8d-1 Healthy
88-
✔ Container test-pg-t3Fg8d-init-1 Exited
89-
✔ Container test-wait-for-resources-1 Exited
90-
✔ Container test-sample-main-1 Started
94+
[+] Running 7/7
95+
✔ Network nodejs_default Created
96+
✔ Volume "nodejs_pg-Tut8g7-data" Created
97+
✔ Container nodejs-pg-Tut8g7-1 Healthy
98+
✔ Container nodejs-routing-CzbPM2-1 Started
99+
✔ Container nodejs-pg-Tut8g7-init-1 Exited
100+
✔ Container nodejs-wait-for-resources-1 Exited
101+
✔ Container nodejs-hello-world-hello-world-1 Started
91102
```
92103

93104
## 6. `docker ps`
@@ -99,10 +110,10 @@ docker ps
99110
```
100111

101112
```none
102-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
103-
58fbe97161b5 ghcr.io/score-spec/sample-app-gif:main "/sample" 3 hours ago Up 7 seconds test-sample-main-1
104-
e4bdd0126d97 mirror.gcr.io/postgres:17-alpine "docker-entrypoint.s…" 3 hours ago Up About a minute (healthy) 5432/tcp test-pg-t3Fg8d-1
105-
a03dfeea3371 mirror.gcr.io/nginx:1-alpine "/docker-entrypoint.…" 3 hours ago Up About a minute 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp test-routing-avhAWY-1
113+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
114+
8488aa2fe204 scorespec/sample-score-app:latest "node index.js" 17 minutes ago Up 17 minutes 3000/tcp nodejs-hello-world-hello-world-1
115+
22c78e726612 mirror.gcr.io/nginx:1-alpine "/docker-entrypoint.…" 17 minutes ago Up 17 minutes 0.0.0.0:8080->80/tcp, [::]:8080->80/tcp nodejs-routing-CzbPM2-1
116+
01cc858a6162 mirror.gcr.io/postgres:17-alpine "docker-entrypoint.s…" 17 minutes ago Up 17 minutes (healthy) 5432/tcp nodejs-pg-Tut8g7-1
106117
```
107118

108119
## 7. `curl localhost:8080`
@@ -114,7 +125,9 @@ curl localhost:8080
114125
```
115126

116127
```none
117-
SQL VERSION: PostgreSQL 17.4 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
128+
Hello, World!
129+
This is an application talking to a PostgreSQL 17.5 database on host pg-Tut8g7, deployed with Score!
130+
PostgreSQL 17.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 14.2.0) 14.2.0, 64-bit
118131
```
119132

120133
Congrats! You’ve successfully deploy your first Score file with the `score-compose` implementation with a sample workload talking to PostgreSQL and exposed via a DNS. You provisioned them through Docker, without writing the Docker Compose file by yourself.

content/en/docs/overview/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The Score file sits next to your workload’s source code in version control. Bo
5656

5757
## Example
5858

59-
Below you'll find an example of a simple Score application with a web server that queries a PostgreSQL database on each request. The demo code can be found [here](https://github.com/score-spec/sample-app-gif/blob/main/score.yaml).
59+
Below you'll find an example of a simple Score application with a web server that queries a PostgreSQL database on each request. The demo code can be found [here](https://github.com/score-spec/sample-score-app/blob/main/score.yaml).
6060

6161
```yaml
6262
# The version string helps identify the Score file syntax

content/en/docs/score implementation/score-compose/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `score-compose` CLI provides a set of commands and flags to enable the gener
1313

1414
### `--help` | `-h`
1515

16-
Displays help information for `score-compose`, includig available commands and flags.
16+
Displays help information, including available commands and flags.
1717

1818
```bash
1919
score-compose --help

content/en/docs/score implementation/score-k8s/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The `score-k8s` CLI provides a set of commands and flags to enable the generatio
1313

1414
### `--help` | `-h`
1515

16-
Displays help information for `score-k8s`, including available commands and flags.
16+
Displays help information, including available commands and flags.
1717

1818
```bash
1919
score-k8s --help

0 commit comments

Comments
 (0)