File tree 3 files changed +49
-0
lines changed
3 files changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ BACKEND_ADDRESS = 0.0.0.0:8080
2
+ DATABASE_URL = postgresql://admin:admin@database:5432/db_go-backend-demo
3
+ JWTSECRET = jXn2r5u8x/A?D*G-KaPdSgVkYp3s6v9y
4
+
5
+ POSTGRES_USER = admin
6
+ POSTGRES_PASSWORD = admin
7
+ POSTGRES_DB = db_go-backend-demo
Original file line number Diff line number Diff line change
1
+ # To make sure our syntax is up-to-date
2
+ # syntax=docker/dockerfile:1
3
+
4
+ FROM golang:1.17.8-alpine3.15
5
+
6
+ WORKDIR /usr/src/go-backend-demo
7
+ COPY go.mod go.sum ./
8
+ RUN go mod download && go mod verify
9
+
10
+ COPY . .
11
+ RUN go build -v -o /usr/local/bin/go-backend-demo .
12
+
13
+ EXPOSE 8080
14
+
15
+ CMD ["go-backend-demo" ]
Original file line number Diff line number Diff line change
1
+ version : " 3.8"
2
+ services :
3
+ database :
4
+ image : postgres:latest
5
+ container_name : go-backend-db
6
+ restart : always
7
+ env_file :
8
+ - .env
9
+ ports :
10
+ - " 5433:5433"
11
+ volumes :
12
+ - dbdata:/var/lib/postgres/data/
13
+ server :
14
+ container_name : go-backend-demo
15
+ build :
16
+ context : .
17
+ env_file :
18
+ - .env
19
+ networks :
20
+ - default # default bridge network
21
+ ports :
22
+ - " 8080:8080"
23
+ depends_on :
24
+ - database
25
+ volumes :
26
+ dbdata :
27
+
You can’t perform that action at this time.
0 commit comments