Add dockercompose file and script files

This commit is contained in:
Charles Mendiburu 2026-03-28 11:31:19 +01:00
parent eb4df189bb
commit d573327eb7
5 changed files with 66 additions and 0 deletions

52
docker-compose.yaml Normal file
View File

@ -0,0 +1,52 @@
version: '3.8'
services:
db:
image: postgres:17-alpine
container_name: vigimeteo_db
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_DB: postgres
volumes:
- vigimeteo_data:/var/lib/postgresql/data
- ./sql/backup.sql:/docker-entrypoint-initdb.d/init.sql #DB initializes automatically on first run
networks:
- vigimeteo_net
backend:
build:
context: ./Back-end
container_name: vigimeteo_backend
restart: always
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: postgres
DB_USER: postgres
DB_PASSWORD: admin
ports:
- "8888:8888"
depends_on:
- db
networks:
- vigimeteo_net
frontend:
build:
context: ./Front-end
container_name: vigimeteo_frontend
restart: always
ports:
- "5000:80"
depends_on:
- backend
networks:
- vigimeteo_net
volumes:
vigimeteo_data:
networks:
vigimeteo_net:

4
prepare-app.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Preparing app..."
docker-compose build
echo "App is prepared."

3
remove-app.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "Removed app."
docker-compose down -v --rmi local

4
start-app.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo "Running app ..."
docker-compose up -d
echo "The app is available at http://localhost:5000"

3
stop-app.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "Stopping app..."
docker-compose stop