File tree Expand file tree Collapse file tree 2 files changed +15
-20
lines changed Expand file tree Collapse file tree 2 files changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -4,24 +4,23 @@ WORKDIR /go/app
4
4
5
5
COPY . .
6
6
COPY .env .
7
+ COPY .realize.yaml .
7
8
8
9
RUN apk add --no-cache git \
9
10
&& go build -o app
10
11
11
- FROM alpine:3.12.0
12
+ FROM golang:1.14.9-alpine3.12
12
13
13
14
WORKDIR /app
14
15
15
16
COPY --from=build /go/app/app .
16
17
17
- RUN apk add --update --no-cache go git \
18
- && export GOPATH=/root/go \
19
- && export PATH=${GOPATH}/bin:/usr/local/go/bin:$PATH \
20
- && export GOBIN=$GOROOT/bin \
21
- && mkdir -p ${GOPATH}/src ${GOPATH}/bin \
18
+ RUN apk add --no-cache alpine-sdk git \
19
+ && go get -u github.com/oxequa/realize \
22
20
&& addgroup go \
23
21
&& adduser -D -G go go \
24
22
&& chown -R go:go /app/app \
25
23
&& chmod +x /app/app
26
24
27
- CMD ["go" , "run" , "main.go" ]
25
+ # CMD ["go", "run", "main.go"]
26
+ CMD [ "realize" , "start" ]
Original file line number Diff line number Diff line change @@ -42,27 +42,23 @@ go build *.go
42
42
```
43
43
COMMON_APP_ENV=
44
44
```
45
- 1. Start Chrome Headless Server
46
- ```
47
- docker run -d -p 9222:9222 --rm --name headless-shell --shm-size 2G chromedp/headless-shell
45
+ 1. Run command below.
48
46
```
49
- 1. Run server as below. `realize` command allows Hot reloading.
50
- ```shell script
51
- realize start
47
+ docker-compose up
52
48
```
53
49
54
- ## How to run all tests
55
- ```
56
- go test -v -race -run=. -bench=. ./...
57
- ```
58
-
59
- ##How to run for production
60
- 1. Create `.env` based off from `.env.default`
50
+ ## How to run for production
51
+ 1. Create `.env` based off from `.env.default`. Make sure `production` is set to `COMMON_APP_ENV`.
61
52
1. Set API Keys accordingly.
62
53
1. Run command below.
63
54
```
64
55
docker-compose up
65
56
```
57
+
58
+ ## How to run all tests
59
+ ```
60
+ go test -v -race -run=. -bench=. ./...
61
+ ```
66
62
67
63
## How to build Docker image
68
64
This is how to build and confirm the image is built correctly.
You can’t perform that action at this time.
0 commit comments