This commit is contained in:
21
.github/workflows/deploy.yml
vendored
Normal file
21
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Deploy App
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
container:
|
||||||
|
volumes:
|
||||||
|
- /var/docker-web:/var/docker-web
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: install
|
||||||
|
run: |
|
||||||
|
APP_DIR=/var/docker-web/apps/${GITHUB_REPOSITORY##*/}
|
||||||
|
mkdir -p $APP_DIR
|
||||||
|
cp -a $(find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'node_modules') "$APP_DIR/"
|
||||||
|
- name: up
|
||||||
|
run: |
|
||||||
|
export COMPOSE_BAKE=false
|
||||||
|
bash /var/docker-web/src/cli.sh up ${GITHUB_REPOSITORY##*/}
|
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Nuxt dev/build outputs
|
||||||
|
.output
|
||||||
|
.data
|
||||||
|
.nuxt
|
||||||
|
.nitro
|
||||||
|
.cache
|
||||||
|
dist
|
||||||
|
|
||||||
|
# Node dependencies
|
||||||
|
node_modules
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
.DS_Store
|
||||||
|
.fleet
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Local env files
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
CMD npx http-server /mnt/media/files
|
5
config.sh
Executable file
5
config.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
export REPO_NAME="files"
|
||||||
|
export DOMAIN="files.$MAIN_DOMAIN"
|
||||||
|
export PORT="8000"
|
||||||
|
export PORT_EXPOSED="3000"
|
||||||
|
export REDIRECTIONS="" # example.$MAIN_DOMAIN->/route $MAIN_DOMAIN->url /route->/another-route /route->url
|
23
docker-compose.yml
Executable file
23
docker-compose.yml
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
services:
|
||||||
|
files:
|
||||||
|
image: local/files
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: files
|
||||||
|
restart: unless-stopped
|
||||||
|
working_dir: /app
|
||||||
|
ports:
|
||||||
|
- "${PORT}:${PORT_EXPOSED}"
|
||||||
|
volumes:
|
||||||
|
- "${MEDIA_DIR}:/mnt/media"
|
||||||
|
environment:
|
||||||
|
VIRTUAL_HOST: "${DOMAIN}"
|
||||||
|
LETSENCRYPT_HOST: "${DOMAIN}"
|
||||||
|
PUID: "${PUID}"
|
||||||
|
PGID: "${PGID}"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
name: dockerweb
|
||||||
|
external: true
|
10
package.json
Normal file
10
package.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"scripts": {
|
||||||
|
"up": "bash -c 'source ~/docker-web/config.sh && source config.sh && exec docker-compose up'",
|
||||||
|
"down": "bash -c 'source ~/docker-web/config.sh && source config.sh && docker-compose down'",
|
||||||
|
"build": "bash -c 'source ~/docker-web/config.sh && source config.sh && docker-compose build'"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"http-server": "^14.1.1"
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user