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
|
||||
@@ -8,14 +8,12 @@ RUN apk --no-cache add bash zsh git go \
|
||||
|
||||
RUN mkdir /usr/share/webapps/
|
||||
COPY ./build/expensesweb/ /usr/share/webapps/expensesweb
|
||||
RUN chown -R esilva:esilva /usr/share/webapps/expensesweb
|
||||
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
|
||||
# Add the entrypoint
|
||||
USER $UNAME
|
||||
COPY ./start.sh /start.sh
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT [ "/start.sh" ]
|
||||
|
||||
+3
-9
@@ -26,25 +26,19 @@ devdb_stop:
|
||||
podman compose stop database
|
||||
|
||||
build_image: build_release_alpine
|
||||
docker buildx build -t $(registry)/$(repo)/expensesweb:$(tag) .
|
||||
podman build -t $(registry)/$(repo)/expensesweb:$(tag) .
|
||||
|
||||
launch_container:
|
||||
docker run \
|
||||
podman run \
|
||||
-p 8081:8081 \
|
||||
-v ./data/data.db:/usr/share/webapps/expensesweb/data/data.db \
|
||||
-it $(registry)/$(repo)/expensesweb:$(tag) zsh
|
||||
|
||||
push_image:
|
||||
docker push $(registry)/$(repo)/expensesweb:$(tag)
|
||||
podman push $(registry)/$(repo)/expensesweb:$(tag)
|
||||
|
||||
test:
|
||||
# go test ./... -cover -bench=
|
||||
go test -coverprofile=coverage.out ./...
|
||||
go tool cover -html=coverage.out -o coverage.html
|
||||
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
|
||||
pass: expDBPass
|
||||
db: expenses
|
||||
host: "127.0.0.1"
|
||||
port: 5431
|
||||
host: "database"
|
||||
port: 5432
|
||||
migrationsPath: "file://expenses/repo/pgdb/migrations/"
|
||||
migCustomScripts: "./expenses/repo/pgdb/migrations/custom/"
|
||||
|
||||
@@ -1,4 +1,17 @@
|
||||
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:
|
||||
image: docker.io/library/postgres:16
|
||||
container_name: expenses-dev-db
|
||||
@@ -7,4 +20,9 @@ services:
|
||||
- .pgenv
|
||||
ports:
|
||||
- "5431:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d expenses"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ REQUIRED_VARS := registry repo
|
||||
$(foreach v,$(REQUIRED_VARS),\
|
||||
$(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