Enhance Docker setup and configuration loading for improved environment management
This commit is contained in:
5
cmd/server/Dockerfile
Normal file
5
cmd/server/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /app
|
||||||
|
COPY main .
|
||||||
|
RUN apk add gcompat
|
||||||
|
CMD ["./main"]
|
||||||
@@ -99,7 +99,6 @@ func main() {
|
|||||||
err := initDotenv()
|
err := initDotenv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logMessage("error", "Failed to load .env file: %v", err)
|
logMessage("error", "Failed to load .env file: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
logMessage("info", "Starting the SIPRO Marketplace Server... 🚀1")
|
logMessage("info", "Starting the SIPRO Marketplace Server... 🚀1")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|||||||
5
cmd/tasks_server/Dockerfile
Normal file
5
cmd/tasks_server/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM alpine:latest
|
||||||
|
WORKDIR /app
|
||||||
|
COPY main .
|
||||||
|
RUN apk add gcompat
|
||||||
|
CMD ["./main"]
|
||||||
@@ -2,10 +2,22 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: git.denco.store/fakz9/sipro-marketplaces:latest
|
image: git.denco.store/fakz9/sipro-marketplaces:latest
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
worker:
|
||||||
|
image: git.denco.store/fakz9/sipro-marketplaces-worker:latest
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
networks:
|
||||||
|
- appnet
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfig() (*Config, error) {
|
func LoadConfig() (*Config, error) {
|
||||||
err := godotenv.Load()
|
_ = godotenv.Load()
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
redisConfig := LoadRedisConfig()
|
redisConfig := LoadRedisConfig()
|
||||||
databaseConfig := LoadDatabaseConfig()
|
databaseConfig := LoadDatabaseConfig()
|
||||||
return &Config{Redis: redisConfig, Database: databaseConfig}, nil
|
return &Config{Redis: redisConfig, Database: databaseConfig}, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user