diff --git a/.gitignore b/.gitignore index 1666735..09a5f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules public/css/output.css .env tmp +main diff --git a/Jenkinsfile b/Jenkinsfile index 4322d81..6338fed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,13 @@ pipeline { stage('Populate env') { steps { sh 'rm .env || true' - sh 'echo "PORT=8007" > .env' + sh 'echo "PORT=8007" >> .env' + sh 'echo "DB_HOST=localhost" >> .env' + sh 'echo "DB_PORT=5432" >> .env' + sh 'echo "DB_DATABASE=music" >> .env' + sh 'echo "DB_USERNAME=root" >> .env' + sh 'echo "DB_PASSWORD=root" >> .env' + sh 'echo "DB_SCHEMA=public" >> .env' } } stage('Profit') { diff --git a/db/init.sql b/db/init.sql new file mode 100644 index 0000000..97a73e1 --- /dev/null +++ b/db/init.sql @@ -0,0 +1,3 @@ +create database music; + + diff --git a/docker-compose.yml b/docker-compose.yml index 5a16eff..b5fbb7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ services: - dev.araozu.music: + music-to-go: container_name: music-to-go build: context: . @@ -7,3 +7,15 @@ services: ports: - "8007:8007" restart: unless-stopped + music-to-go-db: + image: postgres + container_name: music-to-go-db + restart: unless-stopped + # set shared memory limit when using docker-compose + shm_size: 128mb + volumes: + - ./db:/docker-entrypoint-initdb.d + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root +