Skip to content

Commit a81280b

Browse files
committed
restored initial working version
1 parent 7124770 commit a81280b

File tree

279 files changed

+21011
-3783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+21011
-3783
lines changed

.air.toml

-37
This file was deleted.

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ DB_PASSWORD=""
6969
# ===============================================
7070
# == VAULT
7171
# ===============================================
72-
VAULT_KEY="c5od6Kb!dIw8TLr&m19*@28N$D4$&$%0zRzE4lUMd%1#m*gm2cqjWolQ@v27U0QQ0K3bw1$8h8E5FxE1Wkw5UVBplOxu3SVhhQ&"
72+
# VAULT_KEY="c5od6Kb!dIw8TLr&m19*@28N$D4$&$%0zRzE4lUMd%1#m*gm2cqjWolQ@v27U0QQ0K3bw1$8h8E5FxE1Wkw5UVBplOxu3SVhhQ&"
7373

7474
# ===============================================
7575
# == VERTEXAI

.env_example

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ SERVER_PORT="32322"
77
# ===============================================
88
# == ENVENC
99
# ===============================================
10-
ENV_ENCRYPTION_KEY=""
10+
ENVENC_KEY_PRIVATE=""
1111

1212
# ===============================================
1313
# == APP
1414
# ===============================================
15-
APP_ENV="development"
1615
APP_NAME="YOUR APP NAME"
1716
APP_URL="http://127.0.0.1:32322"
17+
APP_ENV="development"
1818

1919
# ===============================================
2020
# == DATABASE

.gcloudignore

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ignore .env files, enter directly on Google Cloud Run
2+
.env
3+
.env.example
4+
.env*
5+
6+
# ignore .git and .cache folders
7+
.git
8+
.cache
9+
10+
# ignore docker folder
11+
/docker
12+
13+
# ignore all *.class files in all folders, including build root
14+
**/*.class
15+
16+
# ignore all *.class files in all folders, including build root
17+
**/*.class
18+
19+
# ignore all *.db files in all folders, including build root
20+
**/*.database
21+
**/*.db
22+
**/*.sqlite
23+
24+
# ignore all markdown files (md) beside all README*.md other than README-secret.md
25+
*.md
26+
# !README*.md
27+
# README-secret.md
28+
29+
# ignore .vscode folder
30+
/.github
31+
/.github/*
32+
33+
# ignore .vscode folder
34+
/.vscode
35+
36+
37+
# ignore /bin folder files
38+
/bin
39+
/bin/*
40+
41+
# ignore /cordova folder files
42+
/cordova
43+
/cordova/*
44+
45+
# ignore /documents folder files
46+
/docs
47+
/docs/*
48+
/documents
49+
/documents/*
50+
51+
# ignore /tmp folder files
52+
/tmp
53+
/tmp/*
54+
55+
# ignore /vendor folder
56+
/vendor/*
57+
58+
.gitlab-ci.yaml
59+
Taskfile.yml

.gitignore

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
4+
# Binaries for programs and plugins
5+
*.exe
6+
*.exe~
7+
*.dll
8+
*.so
9+
*.dylib
10+
11+
# Test binary, built with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Dependency directories (remove the comment below to ignore)
18+
# vendor/
19+
20+
# Go workspace file
21+
go.work
22+
23+
# Env files
24+
.env
25+
.env.vault
26+
27+
tmp/
28+
29+
database.sqlite
30+
database.db
31+
database.db-journal
32+
33+
google-cloud-cli-*
34+
google-cloud-sdk/
35+
36+
.cache/

.gitpod.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
tasks:
6+
- name: Install Taskfile
7+
command: go install github.com/go-task/task/v3/cmd/task@latest
8+
9+
# - name: Install the GCloud CLI
10+
# init: |
11+
# sudo apt-get install -y apt-transport-https ca-certificates gnupg
12+
# curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-444.0.0-linux-x86_64.tar.gz
13+
# tar -xf google-cloud-cli-444.0.0-linux-x86_64.tar.gz
14+
# command: ./google-cloud-sdk/install.sh --path-update=true --quiet
15+
16+
- name: Install Air
17+
command: go install github.com/cosmtrek/air@latest
18+
19+
- name: Prepare .env file
20+
command: cp .env_example .env
21+
22+
- name: Install Dependencies and Run
23+
init: go get && go build ./... && go test ./...
24+
command: go run

.vscode/launch.json

-19
This file was deleted.

Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# 1. Use the official Golang image to create a build artifact.
2+
# ===============================================================
3+
# This is based on Debian and sets the GOPATH to /go.
4+
# https://hub.docker.com/_/golang
5+
FROM golang:1.24.0 as builder
6+
7+
# Create and change to the app directory.
8+
WORKDIR /app
9+
10+
# 2. Retrieve application dependencies using go modules.
11+
# ===============================================================
12+
# Allows container builds to reuse downloaded dependencies.
13+
COPY go.* ./
14+
RUN go mod download
15+
16+
# Copy local code to the container image.
17+
COPY . ./
18+
19+
# 3. Build the binary.
20+
# ===============================================================
21+
# -mod=readonly ensures immutable go.mod and go.sum in container builds.
22+
# RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
23+
24+
RUN CGO_ENABLED=0 GOOS=linux go build -v -o server
25+
26+
# 4. Use the official Alpine image for a lean production container.
27+
# ===============================================================
28+
# https://hub.docker.com/_/alpine
29+
# https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds
30+
FROM alpine:3
31+
RUN apk add --no-cache ca-certificates
32+
RUN apk add --no-cache tzdata
33+
ENV TZ="UTC"
34+
35+
# Alternative using Debian Slim
36+
# ===============================================================
37+
# FROM debian:buster-slim
38+
# RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
39+
# ca-certificates && \
40+
# rm -rf /var/lib/apt/lists/*
41+
42+
# 5. Copy the binary to the production image from the builder stage.
43+
# ===============================================================
44+
COPY --from=builder /app/server /server
45+
46+
# COPY --from=builder /app/views /views
47+
48+
# Run the web service on container startup.
49+
CMD ["/server"]

0 commit comments

Comments
 (0)