Merge pull request #47 from zdam-egzamin-zawodowy/move-main-go-and-dockerfile-to-specific-folders

move main.go to cmd/server, move Dockerfile to build/server, update README.md
This commit is contained in:
Dawid Wysokiński 2021-11-01 07:49:17 +01:00 committed by GitHub
commit 5eb7f0e635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 17 deletions

View File

@ -42,5 +42,5 @@ jobs:
tags: |
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:latest
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:${{ steps.get_version.outputs.VERSION }}
file: ./Dockerfile
file: ./build/server/Dockerfile
push: true

View File

@ -23,15 +23,9 @@ FILE_STORAGE_PATH=path_to_the_folder_where_uploaded_files_will_be_stored
ENABLE_ACCESS_LOG=false
```
1. Clone this repo.
```
git clone git@github.com:zdam-egzamin-zawodowy/backend.git
```
1. Clone this repo - ``git clone git@github.com:zdam-egzamin-zawodowy/backend.git``.
2. Set the required env variables.
3. Run the app.
```
go run main.go
```
3. Run the app - ``go run ./cmd/server/main.go``.
## License
Distributed under the MIT License. See ``LICENSE`` for more information.

View File

@ -10,10 +10,10 @@ COPY go.mod go.sum ./
RUN go mod download
# Copy the source from the current directory to the Working Directory inside the container
COPY . .
COPY ../.. .
RUN apk --no-cache add musl-dev gcc build-base
RUN go generate ./...
RUN go build -o zdamegzawodowy .
RUN go build -o zdamegzawodowy ./cmd/server
######## Start a new stage from scratch #######
FROM alpine:latest
@ -26,10 +26,6 @@ WORKDIR /root/
COPY --from=builder /app/zdamegzawodowy .
ENV APP_MODE=production
ENV GIN_MODE=release
EXPOSE 8080
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait ./wait
RUN chmod +x ./wait
CMD ./wait && ./zdamegzawodowy

2
go.sum
View File

@ -35,8 +35,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/go-chi/chi/v5 v5.0.3/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.4 h1:5e494iHzsYBiyXQAHHuI4tyJS9M3V84OuX3ufIIGHFo=
github.com/go-chi/chi/v5 v5.0.4/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.5 h1:l3RJ8T8TAqLsXFfah+RA6N4pydMbPwSdvNM+AFWvLUM=
github.com/go-chi/chi/v5 v5.0.5/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/cors v1.2.0 h1:tV1g1XENQ8ku4Bq3K9ub2AtgG+p16SmzeMSGTwrOKdE=