docker files and deployment script
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 0s
This commit is contained in:
parent
b171956105
commit
3843be7675
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@ -0,0 +1,15 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
RUN npm install -g pnpm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pnpm build
|
||||
|
||||
CMD ["pnpm", "start"]
|
||||
15
deploy.sh
Normal file
15
deploy.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <project_path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROJECT_PATH=$1
|
||||
|
||||
echo "Deploying project..."
|
||||
cd "$PROJECT_PATH" || { echo "Directory not found: $PROJECT_PATH"; exit 1; }
|
||||
git pull origin main
|
||||
docker compose up -d --no-deps --build nextapp
|
||||
echo "Deployment finished!"
|
||||
42
docker-compose.yml
Normal file
42
docker-compose.yml
Normal file
@ -0,0 +1,42 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
nextapp:
|
||||
build: .
|
||||
deploy:
|
||||
update_config:
|
||||
parallelism: 1
|
||||
delay: 5s
|
||||
order: start-first
|
||||
container_name: logipedia
|
||||
restart: always
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.logipedia.rule=Host(`logipedia.shortman.me`)"
|
||||
- "traefik.http.routers.logipedia.entrypoints=websecure"
|
||||
- "traefik.http.services.logipedia.loadbalancer.server.port=3000"
|
||||
- "traefik.http.routers.logipedia.tls.certresolver=myresolver"
|
||||
expose:
|
||||
- "3000"
|
||||
# ports:
|
||||
# - "3000:3000"
|
||||
networks:
|
||||
- webproxy
|
||||
db:
|
||||
image: postgres:latest
|
||||
container_name: logipedia-db
|
||||
restart: always
|
||||
shm_size: 128mb
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
webproxy:
|
||||
external: true
|
||||
Loading…
x
Reference in New Issue
Block a user