Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6e1b5bc

Browse files
* docker-compose.yml added under docker folder.
* readme.md changed.
1 parent bb24181 commit 6e1b5bc

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

‎README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Description
22

3-
This project is a *Go language* learning project with simple RestFul services. It uses postgres db inside with DockerFile. You can get image with dockerfile or create your own postgres database without it.
3+
This project is a *Go language* learning project with simple RestFul services. It uses postgres db inside with docker-compose. You can compose with dockerfile or create your own postgres database without it.
44

5-
For DockerFile help, you can review the following link.
5+
For run docker-compose, you need to write following commands. In your project folder,
66

7-
[Dockerize Postgres](https://docs.docker.com/engine/examples/postgresql_service/)
7+
```
8+
cd docker
9+
docker-compose up
10+
```
11+
12+
then PostgreSQL works on 32300 Port (32300 -> 5432). You can access with database IDE (DataGrip, Intellij etc.) with configure port 32300.
13+
14+
If you want to conncect from your host system type the following command to terminal.
15+
```
16+
psql -h localhost -p 32300 -d docker -U docker --password
17+
```
18+
19+
For more information about it,
20+
21+
[Dockerize PostgreSQL](https://docs.docker.com/engine/examples/postgresql_service/#connecting-from-your-host-system)
822

923
# Database table configuration
1024
```

‎config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ const (
44
DB_USER = "docker"
55
DB_PASSWORD = "docker"
66
DB_NAME = "docker"
7-
PORT = "32770"
7+
PORT = "32300"
88
)
File renamed without changes.

‎docker/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3'
2+
services:
3+
4+
postgres:
5+
build:
6+
context: ../
7+
dockerfile: docker/Dockerfile-Postgres
8+
ports:
9+
- "32300:5432"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /