Skip to content

Commit 94cf255

Browse files
authored
.... should have ran a test (#41)
1 parent aa226d2 commit 94cf255

6 files changed

Lines changed: 62 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ music/
7979
music_dev/
8080
*.db
8181
*.env
82-
database/data
82+
dev_database/data
8383
*.pid

MyMusicBoxApi/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import (
1414
)
1515

1616
func main() {
17+
configuration.LoadConfiguration()
18+
1719
database.CreateDatabasConnectionPool()
1820
defer database.DbInstance.Close()
1921

2022
// If yt-dlp isn't installed yet, download and cache it for further use.
2123
ytdlp.MustInstall(context.TODO(), nil)
2224

23-
configuration.LoadConfiguration()
24-
2525
setGinMode()
2626

2727
ginEngine := gin.Default()

MyMusicBoxApi/run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
./stop
23

34
sudo go run main.go -port=8081 -devurl -sourceFolder="music_dev" -outputExtension="opus" &
45

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Use postgres/example user/password credentials
2+
services:
3+
prod_db:
4+
image: postgres
5+
restart: always
6+
env_file: "/home/admin/docker-env/database.env"
7+
# set shared memory limit when using docker compose
8+
shm_size: 128mb
9+
volumes:
10+
- "/home/admin/mymusicbox_production/database/data-production:/var/lib/postgresql/data"
11+
- "/home/admin/mymusicbox_production/database/initscripts:/docker-entrypoint-initdb.d"
12+
# /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*:q
13+
#user: 1000:1000
14+
ports:
15+
- "127.0.0.1:5432:5432"
16+
# or set shared memory limit when deploy via swarm stack
17+
#volumes:
18+
#dev_data:
19+
# - type: tmpfs
20+
# target: /dev/shm
21+
# tmpfs:
22+
# size: 134217728 # 128*2^20 bytes = 128Mb
23+
#environment:
24+
#POSTGRES_PASSWORD: example
25+
prod_adminer:
26+
image: adminer
27+
restart: always
28+
ports:
29+
- 8085:8080

dev_database/docker-compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Use postgres/example user/password credentials
2+
services:
3+
dev_db:
4+
image: postgres
5+
restart: always
6+
env_file: "/home/admin/docker-env/database.env"
7+
# set shared memory limit when using docker compose
8+
shm_size: 128mb
9+
volumes:
10+
- "/home/admin/projects/workspace/dev_database/data:/var/lib/postgresql/data"
11+
- "/home/admin/projects/workspace/dev_database/initscripts:/docker-entrypoint-initdb.d"
12+
# /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
13+
#user: 1000:1000
14+
ports:
15+
- "127.0.0.1:5433:5432"
16+
# or set shared memory limit when deploy via swarm stack
17+
#volumes:
18+
#dev_data:
19+
# - type: tmpfs
20+
# target: /dev/shm
21+
# tmpfs:
22+
# size: 134217728 # 128*2^20 bytes = 128Mb
23+
#environment:
24+
#POSTGRES_PASSWORD: example
25+
dev_adminer:
26+
image: adminer
27+
restart: always
28+
ports:
29+
- 8086:8080

0 commit comments

Comments
 (0)