refactor: use bin instead of build directory
This commit is contained in:
parent
8c6ded6794
commit
ff29c49867
@ -16,7 +16,7 @@
|
||||
<kind value="PACKAGE" />
|
||||
<package value="golang-app" />
|
||||
<directory value="$PROJECT_DIR$" />
|
||||
<output_directory value="$PROJECT_DIR$/build" />
|
||||
<output_directory value="$PROJECT_DIR$/bin" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@ -1,6 +1,5 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="go test application" type="GoTestRunConfiguration" factoryName="Go Test">
|
||||
<module name="smart-bot" />
|
||||
<working_directory value="$PROJECT_DIR$" />
|
||||
<EXTENSION ID="net.ashald.envfile">
|
||||
<option name="IS_ENABLED" value="true" />
|
||||
@ -13,11 +12,11 @@
|
||||
<ENTRY IS_ENABLED="true" PARSER="env" PATH=".env" />
|
||||
</ENTRIES>
|
||||
</EXTENSION>
|
||||
<framework value="gotest" />
|
||||
<kind value="DIRECTORY" />
|
||||
<package value="smart-bot" />
|
||||
<package value="golang-app" />
|
||||
<directory value="$PROJECT_DIR$" />
|
||||
<filePath value="$PROJECT_DIR$" />
|
||||
<framework value="gotest" />
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@ -18,7 +18,7 @@ RUN go mod download
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN go build -ldflags "-s -w" -o /bin/app .
|
||||
RUN go build -ldflags "-s -w" -o bin/app .
|
||||
|
||||
FROM scratch
|
||||
|
||||
@ -35,7 +35,7 @@ WORKDIR /
|
||||
|
||||
# Copy binary from build to main folder
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=builder /bin/app app
|
||||
COPY --from=builder /source/bin/app app
|
||||
|
||||
# Copy some application assets
|
||||
#COPY --from=builder /source/deploy/docker/environment.sh ./deploy/docker/environment.sh
|
||||
|
||||
2
Makefile
2
Makefile
@ -18,4 +18,4 @@ build:
|
||||
|
||||
run:
|
||||
make build-backoffice-gateway
|
||||
./build/app
|
||||
./bin/app
|
||||
|
||||
@ -12,12 +12,12 @@ cp .env.dist .env
|
||||
#### Build application
|
||||
``` shell
|
||||
go mod tidy
|
||||
go build -ldflags "-s -w" -o build/app .
|
||||
go build -ldflags "-s -w" -o bin/app .
|
||||
```
|
||||
|
||||
#### Run application
|
||||
``` shell
|
||||
env $(cat .env|xargs) ./build/app
|
||||
env $(cat .env|xargs) ./bin/app
|
||||
```
|
||||
|
||||
#### Test application
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user