Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM postgres:latest
ENV POSTGRES_USER=admin
ENV POSTGRES_PASSWORD=AdminPassword123
ENV POSTGRES_DB=cogitans
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,16 @@ TODO - _UX_
* файл должен содержать абсолютный путь до файла конфигурации yaml
* файл должен лежать рядом с main.go

## 1. Запуск
## 2. Поднятие баз данных через docker

### Postgres
`docker build -t cogitans .`<br>
`docker run -d --name <name> -p 5433:5432 <name>`

### Redis
`docker run -d --name <name> -p 6379:6379 redis redis-server --requirepass <password>`

## 3. Запуск
* go run .
## 4. Деплой
* [Сайт](http://jantugan.ru)
Expand Down
14 changes: 0 additions & 14 deletions cmd/2024_1_ResCogitans/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ import (
_ "github.com/swaggo/http-swagger/example/go-chi/docs"
)

// @title Swagger Example API
// @version 1.0
// @description This is a sample server seller server.
// @termsOfService http://swagger.io/terms/

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email support@swagger.io

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host localhost:8080
// @BasePath /api/v1
func main() {
logger := logger.Logger()
cfg, err := config.LoadConfig()
Expand Down
1 change: 0 additions & 1 deletion config/local.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
env: "local"
storage_path: "./storage/storage.db"
http_server:
address: "localhost:8080"
timeout: 4s
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/go-park-mail-ru/2024_1_ResCogitans
go 1.22.0

require (
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-chi/chi/v5 v5.0.12
github.com/go-redis/redis/v8 v8.11.5
github.com/gorilla/securecookie v1.1.2
Expand Down Expand Up @@ -32,6 +31,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/lib/pq v1.10.2 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/tools v0.20.0 // indirect
Expand Down
1 change: 0 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

type Config struct {
Env string `yaml:"env" env:"ENV" env-required:"true"`
StoragePath string `yaml:"storage_path" env-required:"true"`
HTTPServer `yaml:"http_server"`
Dsn `yaml:"dsn"`
Redis `yaml:"redis"`
Expand Down
2 changes: 1 addition & 1 deletion internal/delivery/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/jackc/pgx/v5/pgxpool"
)

// GetPostgress gets connection to postgres database
// GetPostgres gets connection to postgres database
func GetPostgres() (*pgxpool.Pool, error) {
log := logger.Logger()

Expand Down
Loading