small prod -> dev fixes
This commit is contained in:
parent
4a1a088fac
commit
290d0d1f48
|
|
@ -89,7 +89,6 @@ func Run(conf domain.Config, opts DiscordOptions) error {
|
|||
|
||||
// UPDATE FORUM IF NEEDED:
|
||||
|
||||
// forum, err := session.Channel(os.Getenv("TASKS_CHANNEL"))
|
||||
forum, err := s.Channel(conf.Discord.IsProjectChannel)
|
||||
if err != nil {
|
||||
log.Print(err)
|
||||
|
|
@ -106,7 +105,7 @@ func Run(conf domain.Config, opts DiscordOptions) error {
|
|||
var cmds []*discordgo.ApplicationCommand
|
||||
var logString []string
|
||||
for _, h := range router.Commands {
|
||||
cmd, err := s.ApplicationCommandCreate(s.State.User.ID, "1103928338898235462", &h.Command)
|
||||
cmd, err := s.ApplicationCommandCreate(s.State.User.ID, "", &h.Command)
|
||||
if err != nil {
|
||||
log.Panicf("Cannot create '%v' command: %v", h.Command.Name, err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,11 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
envfile = "../develop.env"
|
||||
envfile = ".env"
|
||||
migrationfile = "../internal/storage/migrate"
|
||||
// production env:
|
||||
// envfile = "../docker/prod.env"
|
||||
// migrationfile = "../internal/storage/migrate"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
services:
|
||||
ticket-pimp:
|
||||
container_name: pimp
|
||||
image: naudachu/ticket-pimp
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
# ticket-pimp:
|
||||
# container_name: pimp
|
||||
# image: naudachu/ticket-pimp
|
||||
# ports:
|
||||
# - "8080:8080"
|
||||
# depends_on:
|
||||
# postgres:
|
||||
# condition: service_healthy
|
||||
postgres:
|
||||
container_name: db
|
||||
image: "postgres:16.1-alpine3.18"
|
||||
|
|
@ -14,14 +14,10 @@ services:
|
|||
POSTGRES_DB: "tickets"
|
||||
POSTGRES_USER: "postgres"
|
||||
POSTGRES_PASSWORD: "postgres"
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: [ "CMD", "pg_isready", "-q", "-d", "tickets", "-U", "postgres" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volume:
|
||||
db-data:
|
||||
retries: 5
|
||||
11
readme.md
11
readme.md
|
|
@ -8,13 +8,20 @@
|
|||
1. Вытягиваем новый образ: `scp ./compose.yaml root@serverhost:~/compose.yaml`
|
||||
2. Запуск контейнера: `docker-compose up -d`
|
||||
|
||||
# Migrations / sqlc:
|
||||
# Разработка:
|
||||
|
||||
## Запуск вспомогательного контейнера с базой:
|
||||
`docker-compose -f compose.dev.yaml up -d`
|
||||
|
||||
## Migrations / sqlc:
|
||||
*Deprecated*, т.к. проверяем и делаем миграции в коде.
|
||||
|
||||
```
|
||||
cd ${PROJECT_FOLDER}/internal/storage
|
||||
sql-migrate up
|
||||
|
||||
```
|
||||
|
||||
# Repository code-gen
|
||||
## Repository code-gen
|
||||
Запулить докер sqlc: `docker pull sqlc/sqlc`
|
||||
Запустить команду из корня проекта: `cd ./internal/storage && docker run --rm -v "$(pwd):/src" -w /src sqlc/sqlc generate`
|
||||
Loading…
Reference in New Issue