Upload files to "z1"

This commit is contained in:
Somangsu Mukherjee 2026-03-31 08:33:27 +00:00
commit e5b5daad52
7 changed files with 58 additions and 0 deletions

BIN
z1/.gitkeep Normal file

Binary file not shown.

40
z1/docker-compose.yml Normal file
View File

@ -0,0 +1,40 @@
services:
frontend:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./frontend:/usr/share/nginx/html
depends_on:
- backend
restart: always
backend:
build: ./backend
ports:
- "3000:3000"
depends_on:
- db
restart: always
db:
image: postgres:15
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mydb
volumes:
- pgdata:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
restart: always
adminer:
image: adminer
ports:
- "8081:8080"
depends_on:
- db
restart: always
volumes:
pgdata:

4
z1/init.sql Normal file
View File

@ -0,0 +1,4 @@
CREATE TABLE IF NOT EXISTS names (
id SERIAL PRIMARY KEY,
name TEXT
);

4
z1/prepare-app.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker compose build
docker volume create pgdata
echo "Prepared!"

4
z1/remove-app.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker compose down -v
docker volume rm pgdata 2>/dev/null
echo "Removed everything"

3
z1/start-app.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker compose up -d
echo "Running at http://localhost:8080"

3
z1/stop-app.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker compose down
echo "Stopped"