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: content/en/docs/a1.hello-world-server.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,14 +182,13 @@ EXPOSE 8080
182
182
> We can use `docker ps` command to see more info. To stop the container `docker stop <name>` and to remove the image `docker rmi -f <image-id>`.
183
183
184
184
185
-
## `docker-compose.yml`
185
+
## `compose.yml`
186
186
187
-
> [📖 Docker Compose](https://docs.docker.com/compose/) is a **tool for defining and running multi-container Docker applications**. With a single command, we can create and start all the services according to the content in the `docker-compose.yml` file. 🔍 If you are new to Docker Compose, I recommend you to read its [**Get Started guild**](https://docs.docker.com/compose/gettingstarted/) on its official documentation.
187
+
> [📖 Docker Compose](https://docs.docker.com/compose/) is a **tool for defining and running multi-container Docker applications**. With a single command, we can create and start all the services according to the content in the `compose.yml` file. 🔍 If you are new to Docker Compose, I recommend you to read its [**Get Started guild**](https://docs.docker.com/compose/gettingstarted/) on its official documentation.
188
188
189
-
Let’s add the `docker-compose.yml`.
189
+
Let’s add the `compose.yml`.
190
190
191
191
```dockerfile
192
-
version: '3'
193
192
services:
194
193
195
194
app:
@@ -198,9 +197,9 @@ services:
198
197
- "8080:8080"
199
198
```
200
199
201
-
- You can use `docker-compose build` and `docker-compose up` commands, to build and run the application.
200
+
- You can use `dockercompose build` and `dockercompose up` commands, to build and run the application.
202
201
- You should see the same response, `Hello, world!` text while visit [localhost:8080/hello](http://localhost:8080/hello) in the browser.
203
-
- Use the `docker-compose down` command to stop the application.
202
+
- Use the `dockercompose down` command to stop the application.
Copy file name to clipboardExpand all lines: content/en/docs/a2.database-and-migrations.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,9 @@ In this article series, we are building a RESTful CRUD API for a simple bookshel
31
31
32
32
We'll use the [official Postgres Alpine Docker image](https://hub.docker.com/_/postgres) to build our development database.
33
33
34
-
Let's update the `docker-compose.yml` file,
34
+
Let's update the `compose.yml` file,
35
35
36
36
```dockerfile
37
-
version: '3'
38
37
services:
39
38
40
39
app:
@@ -55,9 +54,9 @@ services:
55
54
restart: always
56
55
```
57
56
58
-
Run `docker-compose down` and `docker-compose up` to rerun the application with the database. Or, you can run `docker-compose up db` to run only the database.
57
+
Run `dockercompose down` and `dockercompose up` to rerun the application with the database. Or, you can run `dockercompose up db` to run only the database.
59
58
60
-
We can use `docker-compose ps` commands to see more info about the running containers.
59
+
We can use `dockercompose ps` commands to see more info about the running containers.
Copy file name to clipboardExpand all lines: content/en/docs/a3.configurations.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ slug: "configurations"
11
11
12
12
## Populate environment variables with Docker
13
13
14
-
💡 We use `docker-compose` with the [`env_file`](https://docs.docker.com/compose/compose-file/compose-file-v3/#env_file) option to load the environment variables into the development environment. If you are using `docker run`, you can use the [`--env-file` option](https://docs.docker.com/engine/reference/commandline/run/#options) with it.
14
+
💡 We use `dockercompose` with the [`env_file`](https://docs.docker.com/compose/compose-file/compose-file-v3/#env_file) option to load the environment variables into the development environment. If you are using `docker run`, you can use the [`--env-file` option](https://docs.docker.com/engine/reference/commandline/run/#options) with it.
15
15
16
16
### 1. Add `.env`
17
17
@@ -32,7 +32,7 @@ DB_DEBUG=true
32
32
33
33
> 💡 `SERVER_DEBUG` and `DB_DEBUG` will be utilized with the application logs and the GORM logs in the future steps.
34
34
35
-
### 2. update `docker-compose.yml`
35
+
### 2. update `compose.yml`
36
36
37
37
```yml
38
38
app:
@@ -44,7 +44,7 @@ DB_DEBUG=true
44
44
- db
45
45
```
46
46
47
-
Run `docker-compose down` and `docker-compose up` to populate the environment variables into the development environment.
47
+
Run `dockercompose down` and `dockercompose up` to populate the environment variables into the development environment.
48
48
49
49
50
50
## Adding configs to the API
@@ -202,7 +202,7 @@ func main() {
202
202
}
203
203
```
204
204
205
-
Run `docker-compose down`, `docker-compose build` and `docker-compose up` to run the application with the recent changes.
205
+
Run `dockercompose down`, `dockercompose build` and `dockercompose up` to run the application with the recent changes.
206
206
207
207
### 5. Run `go mod tidy`
208
208
@@ -213,10 +213,9 @@ When we add a new package and use it, we have to run `go mod tidy` to reorganize
213
213
214
214
> 💡 Because we hardcoded `localhost` for the database host in the previous article, we encountered the `migrate up: dial tcp 127.0.0.1:3306: connect: connection refused` error with the `./bin/migrate up` command. But, with the current configurations, we should be able to run `./bin/migrate up` inside the docker image with the correct host. So, let's automate running migrations on application startup.
215
215
216
-
Usually, starting the database takes more time. So, we need to wait until the database is up before running database migrations. For this, we use `docker-compose``db:`[`healthcheck`](https://docs.docker.com/compose/compose-file/#healthcheck) and `app:`[`depends_on:db:condition`](https://docs.docker.com/compose/compose-file/#depends_on) options.
216
+
Usually, starting the database takes more time. So, we need to wait until the database is up before running database migrations. For this, we use `dockercompose``db:`[`healthcheck`](https://docs.docker.com/compose/compose-file/#healthcheck) and `app:`[`depends_on:db:condition`](https://docs.docker.com/compose/compose-file/#depends_on) options.
Copy file name to clipboardExpand all lines: content/en/docs/a4.routes-and-openapi-specification.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,7 @@ func main() {
150
150
When we add a new package and use it, we have to run `go mod tidy` to reorganize the dependencies in the `go.mod` file.
151
151
152
152
153
-
> 💡 You can use the `docker-compose down`, `docker-compose build`, and `docker-compose up` commands, to build and run the API application to test the recent changes. Alternatively, you can configure your IDE to run `cmd/api/main.go` locally, with the required env variables; Ex: [Running applications in the GoLand IDE](https://www.jetbrains.com/help/go/running-applications.html)
153
+
> 💡 You can use the `dockercompose down`, `dockercompose build`, and `dockercompose up` commands, to build and run the API application to test the recent changes. Alternatively, you can configure your IDE to run `cmd/api/main.go` locally, with the required env variables; Ex: [Running applications in the GoLand IDE](https://www.jetbrains.com/help/go/running-applications.html)
0 commit comments