up
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
.git
|
||||||
|
.env
|
||||||
|
.air.conf
|
||||||
|
logs/
|
||||||
|
session.db
|
||||||
|
node_modules/
|
||||||
|
*.md
|
||||||
|
apiv2
|
||||||
@@ -6,9 +6,9 @@ APP_URL=https://admin.u-site.app
|
|||||||
DB_DRIVER=postgres
|
DB_DRIVER=postgres
|
||||||
DB_HOST=46.202.93.92
|
DB_HOST=46.202.93.92
|
||||||
DB_PORT=5432
|
DB_PORT=5432
|
||||||
DB_USER=usite
|
DB_USER=postgres
|
||||||
DB_PASS=P0sTgR3s!S3guro2025*
|
DB_PASS=0HZ3rRdsJ7paBAHEg07jtJU0RDuDKLthfXZnpsJZWD3ocMWzTQKFbPKlJUvFQFEA
|
||||||
DB_NAME=usite
|
DB_NAME=postgres
|
||||||
|
|
||||||
|
|
||||||
MAIL_HOST=smtp.hostinger.com
|
MAIL_HOST=smtp.hostinger.com
|
||||||
|
|||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
# ──────────────────────────────────────────
|
||||||
|
# Stage 1: Build del frontend (assets JS/CSS)
|
||||||
|
# ──────────────────────────────────────────
|
||||||
|
FROM node:20-alpine AS frontend
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package.json webpack.mix.js postcss.config.js tailwind.config.js ./
|
||||||
|
RUN npm install --frozen-lockfile
|
||||||
|
|
||||||
|
COPY resources/ resources/
|
||||||
|
COPY public/ public/
|
||||||
|
RUN npm run production
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────
|
||||||
|
# Stage 2: Build del binario Go
|
||||||
|
# ──────────────────────────────────────────
|
||||||
|
FROM golang:1.22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Instalar dependencias del sistema necesarias para CGO (argon2, etc.)
|
||||||
|
RUN apk add --no-cache gcc musl-dev
|
||||||
|
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
# Copiar assets del frontend compilados
|
||||||
|
COPY --from=frontend /app/public ./public
|
||||||
|
|
||||||
|
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o apiv2 .
|
||||||
|
|
||||||
|
# ──────────────────────────────────────────
|
||||||
|
# Stage 3: Imagen final mínima
|
||||||
|
# ──────────────────────────────────────────
|
||||||
|
FROM alpine:3.20
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Certificados TLS y timezone
|
||||||
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
|
|
||||||
|
# Copiar binario compilado
|
||||||
|
COPY --from=builder /app/apiv2 .
|
||||||
|
|
||||||
|
# Copiar archivos estáticos y plantillas
|
||||||
|
COPY --from=builder /app/public ./public
|
||||||
|
COPY --from=builder /app/resources/views ./resources/views
|
||||||
|
COPY --from=builder /app/assets ./assets
|
||||||
|
|
||||||
|
# config.yml se monta como volumen o se inyecta vía env en Coolify
|
||||||
|
COPY config.sample.yml ./config.yml
|
||||||
|
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["./apiv2", "-config", "config.yml"]
|
||||||
+4
-4
@@ -9,11 +9,11 @@ database:
|
|||||||
port: 3306
|
port: 3306
|
||||||
postgres: &postgres
|
postgres: &postgres
|
||||||
driver: postgres
|
driver: postgres
|
||||||
host: localhost
|
host: 46.202.93.92
|
||||||
username: postgres
|
username: postgres
|
||||||
password: postgres
|
password: 0HZ3rRdsJ7paBAHEg07jtJU0RDuDKLthfXZnpsJZWD3ocMWzTQKFbPKlJUvFQFEA
|
||||||
port: 5432
|
port: 5432
|
||||||
db_name: casbin
|
db_name: postgres
|
||||||
sqlserver: &sqlserver
|
sqlserver: &sqlserver
|
||||||
driver: sqlserver
|
driver: sqlserver
|
||||||
host: localhost
|
host: localhost
|
||||||
@@ -24,7 +24,7 @@ database:
|
|||||||
sqlite: &sqlite
|
sqlite: &sqlite
|
||||||
driver: sqlite
|
driver: sqlite
|
||||||
db_name: "data.db" # Nombre del archivo de la base de datos SQLite
|
db_name: "data.db" # Nombre del archivo de la base de datos SQLite
|
||||||
sqlserver: *sqlite # Cambia esto si quieres usar otra base de datos como predeterminada
|
default: *postgres
|
||||||
|
|
||||||
server: &server
|
server: &server
|
||||||
name: "USITE "
|
name: "USITE "
|
||||||
|
|||||||
Reference in New Issue
Block a user