move main.go to /cmd/api and Dockerfile to /build/api

This commit is contained in:
Dawid Wysokiński 2021-11-12 17:37:43 +01:00
parent 1e2e6efd0b
commit f130e120fb
Signed by: Kichiyaki
GPG Key ID: EF14026D247EB867
4 changed files with 4 additions and 13 deletions

View File

@ -43,5 +43,5 @@ jobs:
tags: |
${{ secrets.REGISTRY_NAME }}/twhelp-api:latest
${{ secrets.REGISTRY_NAME }}/twhelp-api:${{ steps.get_version.outputs.VERSION }}
file: ./Dockerfile
file: ./build/server/Dockerfile
push: true

View File

@ -133,19 +133,10 @@ LOG_DB_QUERIES=true
DISABLE_ACCESS_LOG=false
```
1. Clone this repo.
```
git clone git@github.com:tribalwarshelp/api.git
```
1. Clone this repo - ``git clone git@github.com:tribalwarshelp/api.git``
2. Open the folder with this project in a terminal.
3. Set the required env variables directly in your system or create .env.local file.
4. Run the app.
```
go run main.go
```
4. Run the app - ``go run ./cmd/api/main.go``
## License

View File

@ -15,7 +15,7 @@ ARG VERSION="0.0.0"
RUN apk --no-cache add musl-dev gcc build-base
RUN go install github.com/99designs/gqlgen@v0.14.0
RUN go generate ./...
RUN go build -ldflags="-X 'main.Version=$VERSION'" -o twhelpapi .
RUN go build -ldflags="-X 'main.Version=$VERSION'" -o twhelpapi ./cmd/api
######## Start a new stage from scratch #######
FROM alpine:latest