File tree 4 files changed +8
-10
lines changed
4 files changed +8
-10
lines changed Original file line number Diff line number Diff line change
1
+ tmp
Original file line number Diff line number Diff line change 1
1
FROM postgres:12 as db
2
2
WORKDIR /app
3
3
COPY ./scripts/db/init.sh /docker-entrypoint-initdb.d
4
+ COPY ./scripts/db/dump.sql ./scripts/db/dump.sql
4
5
5
6
# Ref: https://dev.to/karanpratapsingh/dockerize-your-go-app-46pp
6
7
FROM golang:1.17.2 as app
7
8
WORKDIR /app
8
9
COPY . .
9
- RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
10
10
RUN make install
11
11
RUN make generate
12
12
CMD make run
Original file line number Diff line number Diff line change
1
+ install :
2
+ curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH ) /bin
3
+ go install ./cmd
4
+ go mod tidy
5
+
1
6
dev :
2
- docker compose up -d --build
7
+ docker compose up -d
3
8
docker exec -it backend /bin/bash
4
9
5
- dev-down :
6
- docker compose down
7
-
8
10
run :
9
11
air
10
12
11
- install :
12
- go install ./cmd
13
- go mod tidy
14
-
15
13
test :
16
14
go test ./db -count=1
17
15
go test ./graphql -count=1
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ services:
30
30
ports :
31
31
- 5432:5432
32
32
volumes :
33
- - ./scripts:/app/scripts
34
33
- postgres:/var/lib/postgresql/data
35
34
36
35
volumes :
You can’t perform that action at this time.
0 commit comments