Fix deploy and storage path
This commit is contained in:
@@ -67,5 +67,5 @@ USER transcriber
|
||||
EXPOSE 8080
|
||||
|
||||
# Set entrypoint and default command
|
||||
ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||
# ENTRYPOINT ["/usr/bin/entrypoint"]
|
||||
CMD ["./transcriber"]
|
||||
|
@@ -16,13 +16,13 @@ tasks:
|
||||
DOCKER_IMAGE: transcriber:{{.COMMIT_HASH}}-{{.TIMESTAMP}}
|
||||
cmds:
|
||||
- docker build --pull --file Dockerfile --tag {{.DOCKER_IMAGE}} .
|
||||
# - task: deploy-with-ansible
|
||||
# vars:
|
||||
# DOCKER_IMAGE: '{{.DOCKER_IMAGE}}'
|
||||
- task: deploy-with-ansible
|
||||
vars:
|
||||
DOCKER_IMAGE: '{{.DOCKER_IMAGE}}'
|
||||
|
||||
deploy-with-ansible:
|
||||
internal: true
|
||||
requires:
|
||||
vars: [DOCKER_IMAGE]
|
||||
dir: '/home/av/projects/private/pet-project-server'
|
||||
cmd: ansible-playbook -i production.yml playbook-transcriber.yml --tag=deploy --extra-vars 'transcriber_image={{.DOCKER_IMAGE}}'
|
||||
cmd: ansible-playbook -i production.yml playbook-transcriber.yml --extra-vars 'transcriber_image={{.DOCKER_IMAGE}}'
|
@@ -46,7 +46,7 @@ type TelegramConfig struct {
|
||||
}
|
||||
|
||||
// DefaultConfig returns a Config with default values
|
||||
func DefaultConfig() *Config {
|
||||
func defaultConfig() *Config {
|
||||
return &Config{
|
||||
Server: ServerConfig{
|
||||
Port: 8080,
|
||||
@@ -82,7 +82,7 @@ func LoadConfig(path string) (*Config, error) {
|
||||
return nil, fmt.Errorf("config file not found: %s", path)
|
||||
}
|
||||
|
||||
config := DefaultConfig()
|
||||
config := defaultConfig()
|
||||
|
||||
// Load configuration from file
|
||||
if _, err := toml.DecodeFile(path, &config); err != nil {
|
||||
|
@@ -10,8 +10,6 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
const baseStorageDir = "data/files"
|
||||
|
||||
type TranscribeHandler struct {
|
||||
jobRepo contract.TranscriptJobRepository
|
||||
trsService *service.TranscribeService
|
||||
|
10
main.go
10
main.go
@@ -52,10 +52,8 @@ func main() {
|
||||
// Load configuration
|
||||
cfg, err := config.LoadConfig(*configPath)
|
||||
if err != nil {
|
||||
// If config file doesn't exist, use defaults
|
||||
cfg = config.DefaultConfig()
|
||||
// Log that we're using default config
|
||||
logger.Info("Using default configuration", "config_path", *configPath, "error", err)
|
||||
logger.Error("Unable to load configuration", "config_path", *configPath, "error", err)
|
||||
os.Exit(1)
|
||||
} else {
|
||||
logger.Info("Configuration loaded successfully", "config_path", *configPath)
|
||||
}
|
||||
@@ -66,8 +64,8 @@ func main() {
|
||||
}
|
||||
|
||||
// Создаем директории если они не существуют
|
||||
if err := os.MkdirAll("data/files", 0755); err != nil {
|
||||
logger.Error("Failed to create data/files directory", "error", err)
|
||||
if err := os.MkdirAll(cfg.Storage.Path, 0750); err != nil {
|
||||
logger.Error("Failed to create file storage directory", "path", cfg.Storage.Path, "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user