fix(back) remake file
This commit is contained in:
-11
@@ -1,11 +0,0 @@
|
|||||||
FROM golang:1.22-alpine AS builder
|
|
||||||
WORKDIR /app
|
|
||||||
COPY . .
|
|
||||||
RUN go build -o main cmd/mrp/main.go
|
|
||||||
|
|
||||||
FROM alpine:latest
|
|
||||||
WORKDIR /root/
|
|
||||||
COPY --from=builder /app/main .
|
|
||||||
COPY --from=builder /app/ui/dist ./ui/dist
|
|
||||||
EXPOSE 8080
|
|
||||||
CMD ["./main"]
|
|
||||||
@@ -3,3 +3,6 @@ bin
|
|||||||
main
|
main
|
||||||
.git
|
.git
|
||||||
.env
|
.env
|
||||||
|
uploads/
|
||||||
|
uploads_backups/
|
||||||
|
*.md
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ FROM alpine:latest
|
|||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
|
|
||||||
COPY --from=builder /app/main .
|
COPY --from=builder /app/main .
|
||||||
COPY --from=builder /app/uploads ./uploads
|
|
||||||
|
|
||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
CMD ["./main"]
|
CMD ["./main"]
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"github.com/disintegration/imaging"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
path := "./uploads/items/background.png"
|
||||||
|
|
||||||
|
img, err := imaging.Open(path)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
resized := imaging.Resize(img, 1920, 0, imaging.Lanczos)
|
||||||
|
|
||||||
|
newPath := "./uploads/items/background.jpg"
|
||||||
|
|
||||||
|
err = imaging.Save(resized, newPath, imaging.JPEGQuality(82))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("Готово")
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ func GetItem(c *gin.Context) {
|
|||||||
if item.AvatarURL != "" {
|
if item.AvatarURL != "" {
|
||||||
item.AvatarURL = fmt.Sprintf("/static/items/%s", item.AvatarURL)
|
item.AvatarURL = fmt.Sprintf("/static/items/%s", item.AvatarURL)
|
||||||
} else {
|
} else {
|
||||||
item.AvatarURL = fmt.Sprintf("/static/items/background.png")
|
item.AvatarURL = fmt.Sprintf("/static/items/background.jpg")
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, item)
|
c.JSON(http.StatusOK, item)
|
||||||
@@ -44,7 +44,7 @@ func GetAllItems(c *gin.Context) {
|
|||||||
if items[i].AvatarURL != "" {
|
if items[i].AvatarURL != "" {
|
||||||
items[i].AvatarURL = fmt.Sprintf("/static/items/%s", items[i].AvatarURL)
|
items[i].AvatarURL = fmt.Sprintf("/static/items/%s", items[i].AvatarURL)
|
||||||
} else {
|
} else {
|
||||||
items[i].AvatarURL = fmt.Sprintf("/static/items/background.png")
|
items[i].AvatarURL = fmt.Sprintf("/static/items/background.jpg")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
@@ -24,6 +24,8 @@ services:
|
|||||||
- DB_DSN=host=${DB_HOST} user=${DB_USER} password=${DB_PASSWORD} dbname=${DB_NAME} port=${DB_PORT} sslmode=disable
|
- DB_DSN=host=${DB_HOST} user=${DB_USER} password=${DB_PASSWORD} dbname=${DB_NAME} port=${DB_PORT} sslmode=disable
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
volumes:
|
||||||
|
- ./backend/uploads/:/root/uploads/
|
||||||
|
|
||||||
# Фронтенд на React
|
# Фронтенд на React
|
||||||
frontend:
|
frontend:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
node_modules
|
node_modules/
|
||||||
dist
|
dist/
|
||||||
build
|
build
|
||||||
.git
|
.git
|
||||||
.env
|
.env
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 239 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.8 MiB |
@@ -1,5 +1,5 @@
|
|||||||
import PageLayout from "../components/PageLayout";
|
import PageLayout from "../components/PageLayout";
|
||||||
import bgLayout from "../assets/Исходники/background.png";
|
import bgLayout from "../assets/Исходники/background.jpg";
|
||||||
import Arrow from "../components/Arrow";
|
import Arrow from "../components/Arrow";
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -20,8 +20,8 @@ export default function Dashboard() {
|
|||||||
<div className="mt-10 md:mt-37.5 text-2xl md:text-6xl font-bold text-white flex flex-col">
|
<div className="mt-10 md:mt-37.5 text-2xl md:text-6xl font-bold text-white flex flex-col">
|
||||||
<div
|
<div
|
||||||
className={`transition-all duration-1000 ease-out ${isLoaded
|
className={`transition-all duration-1000 ease-out ${isLoaded
|
||||||
? "translate-x-0 opacity-100"
|
? "translate-x-0 opacity-100"
|
||||||
: "-transition-x-full opacity-0"
|
: "-transition-x-full opacity-0"
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
Свежие морепродукты <br />
|
Свежие морепродукты <br />
|
||||||
|
|||||||
Reference in New Issue
Block a user