added some example configurations
This commit is contained in:
+1
-3
@@ -1,4 +1,4 @@
|
|||||||
FROM dir.esilva.org/esilva/esilva-alpine:v1.0.0
|
FROM alpine:3.24.2
|
||||||
|
|
||||||
|
|
||||||
# Install the required packages
|
# Install the required packages
|
||||||
@@ -8,14 +8,12 @@ RUN apk --no-cache add bash zsh git go \
|
|||||||
|
|
||||||
RUN mkdir /usr/share/webapps/
|
RUN mkdir /usr/share/webapps/
|
||||||
COPY ./build/expensesweb/ /usr/share/webapps/expensesweb
|
COPY ./build/expensesweb/ /usr/share/webapps/expensesweb
|
||||||
RUN chown -R esilva:esilva /usr/share/webapps/expensesweb
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
|
|
||||||
# Add the entrypoint
|
# Add the entrypoint
|
||||||
USER $UNAME
|
|
||||||
COPY ./start.sh /start.sh
|
COPY ./start.sh /start.sh
|
||||||
STOPSIGNAL SIGTERM
|
STOPSIGNAL SIGTERM
|
||||||
ENTRYPOINT [ "/start.sh" ]
|
ENTRYPOINT [ "/start.sh" ]
|
||||||
|
|||||||
+3
-9
@@ -26,25 +26,19 @@ devdb_stop:
|
|||||||
podman compose stop database
|
podman compose stop database
|
||||||
|
|
||||||
build_image: build_release_alpine
|
build_image: build_release_alpine
|
||||||
docker buildx build -t $(registry)/$(repo)/expensesweb:$(tag) .
|
podman build -t $(registry)/$(repo)/expensesweb:$(tag) .
|
||||||
|
|
||||||
launch_container:
|
launch_container:
|
||||||
docker run \
|
podman run \
|
||||||
-p 8081:8081 \
|
-p 8081:8081 \
|
||||||
-v ./data/data.db:/usr/share/webapps/expensesweb/data/data.db \
|
-v ./data/data.db:/usr/share/webapps/expensesweb/data/data.db \
|
||||||
-it $(registry)/$(repo)/expensesweb:$(tag) zsh
|
-it $(registry)/$(repo)/expensesweb:$(tag) zsh
|
||||||
|
|
||||||
push_image:
|
push_image:
|
||||||
docker push $(registry)/$(repo)/expensesweb:$(tag)
|
podman push $(registry)/$(repo)/expensesweb:$(tag)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
# go test ./... -cover -bench=
|
# go test ./... -cover -bench=
|
||||||
go test -coverprofile=coverage.out ./...
|
go test -coverprofile=coverage.out ./...
|
||||||
go tool cover -html=coverage.out -o coverage.html
|
go tool cover -html=coverage.out -o coverage.html
|
||||||
rm ./coverage.out
|
rm ./coverage.out
|
||||||
|
|
||||||
build_db_image:
|
|
||||||
make -C ./pgImage build
|
|
||||||
|
|
||||||
test_db:
|
|
||||||
make -C ./pgImage test
|
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ postgres:
|
|||||||
user: expdbuser
|
user: expdbuser
|
||||||
pass: expDBPass
|
pass: expDBPass
|
||||||
db: expenses
|
db: expenses
|
||||||
host: "127.0.0.1"
|
host: "database"
|
||||||
port: 5431
|
port: 5432
|
||||||
migrationsPath: "file://expenses/repo/pgdb/migrations/"
|
migrationsPath: "file://expenses/repo/pgdb/migrations/"
|
||||||
migCustomScripts: "./expenses/repo/pgdb/migrations/custom/"
|
migCustomScripts: "./expenses/repo/pgdb/migrations/custom/"
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
services:
|
services:
|
||||||
|
backend:
|
||||||
|
image: dir.esilva.org/esilva/expensesweb:v0.1.0
|
||||||
|
container_name: expensesweb
|
||||||
|
hostname: expensesweb
|
||||||
|
depends_on:
|
||||||
|
database:
|
||||||
|
condition: service_healthy
|
||||||
|
ports:
|
||||||
|
- "8081:8081"
|
||||||
|
volumes:
|
||||||
|
- "./config.yaml:/usr/share/webapps/expensesweb/config.yaml"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
database:
|
database:
|
||||||
image: docker.io/library/postgres:16
|
image: docker.io/library/postgres:16
|
||||||
container_name: expenses-dev-db
|
container_name: expenses-dev-db
|
||||||
@@ -7,4 +20,9 @@ services:
|
|||||||
- .pgenv
|
- .pgenv
|
||||||
ports:
|
ports:
|
||||||
- "5431:5432"
|
- "5431:5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d expenses"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
+1
-1
@@ -5,4 +5,4 @@ REQUIRED_VARS := registry repo
|
|||||||
$(foreach v,$(REQUIRED_VARS),\
|
$(foreach v,$(REQUIRED_VARS),\
|
||||||
$(if $(value $(v)),,$(error Variable '$(v)' is required but empty)))
|
$(if $(value $(v)),,$(error Variable '$(v)' is required but empty)))
|
||||||
|
|
||||||
tag = v0.0.94-alpha
|
tag = v0.1.0
|
||||||
|
|||||||
Reference in New Issue
Block a user