Skip to content

Commit 45b021d

Browse files
committedNov 6, 2021
update: backend go
1 parent de004a8 commit 45b021d

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed
 

‎backend-go/.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tmp

‎backend-go/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM postgres:12 as db
22
WORKDIR /app
33
COPY ./scripts/db/init.sh /docker-entrypoint-initdb.d
4+
COPY ./scripts/db/dump.sql ./scripts/db/dump.sql
45

56
# Ref: https://dev.to/karanpratapsingh/dockerize-your-go-app-46pp
67
FROM golang:1.17.2 as app
78
WORKDIR /app
89
COPY . .
9-
RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
1010
RUN make install
1111
RUN make generate
1212
CMD make run

‎backend-go/Makefile

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
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+
16
dev:
2-
docker compose up -d --build
7+
docker compose up -d
38
docker exec -it backend /bin/bash
49

5-
dev-down:
6-
docker compose down
7-
810
run:
911
air
1012

11-
install:
12-
go install ./cmd
13-
go mod tidy
14-
1513
test:
1614
go test ./db -count=1
1715
go test ./graphql -count=1

‎backend-go/docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ services:
3030
ports:
3131
- 5432:5432
3232
volumes:
33-
- ./scripts:/app/scripts
3433
- postgres:/var/lib/postgresql/data
3534

3635
volumes:

0 commit comments

Comments
 (0)