feat: add docker compose run configuration

This commit is contained in:
П$iх 2022-08-08 00:39:22 +03:00
parent f2f9e10f0e
commit ea859546ee
5 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="build and run as service" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="$PROJECT_DIR$/.env.docker" />
<option name="sourceFilePath" value="docker-compose.yml" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="debug as service" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="$PROJECT_DIR$/.env.docker" />
<option name="commandLineOptions" value="--build" />
<option name="sourceFilePath" value="docker-compose-debug.yml" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>

View File

@ -8,7 +8,7 @@ ifneq (,$(wildcard ./.env))
endif endif
fmt: ## Format and fix import order fmt: ## Format and fix import order
goimports -w -local "e46" $(SRC) goimports -w -local "golang-app" $(SRC)
help: ## Display this help screen help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

17
docker-compose-debug.yml Normal file
View File

@ -0,0 +1,17 @@
version: '3.7'
services:
golang-app-debug:
container_name: golang-app
build:
context: .
dockerfile: Debug.Dockerfile
security_opt:
- apparmor=unconfined
cap_add:
- SYS_PTRACE
environment:
- TOKEN=${TOKEN}
- OWNER=${OWNER}
ports:
- "4040:4040"

9
docker-compose.yml Normal file
View File

@ -0,0 +1,9 @@
version: '3.7'
services:
golang-app:
container_name: golang-app
image: psssix/golang-app:latest
environment:
- TOKEN=${TOKEN}
- OWNER=${OWNER}