Merge pull request #75 from AyushSehrawat/docker-setup
chore: Add docker image workflow and release-please
This commit is contained in:
+23
-1
@@ -1 +1,23 @@
|
||||
node_modules
|
||||
.git/
|
||||
.gitignore
|
||||
.dockerignore
|
||||
docker-compose*
|
||||
Dockerfile
|
||||
makefile
|
||||
htmlcov/
|
||||
coverage.xml
|
||||
.coverage*
|
||||
|
||||
.vscode/
|
||||
*.dat
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
/build
|
||||
/package
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
vite.config.js.timestamp-*
|
||||
vite.config.ts.timestamp-*
|
||||
.idea
|
||||
@@ -0,0 +1,41 @@
|
||||
DOCKER=true
|
||||
|
||||
MONGODB_URL=mongodb://127.0.0.1:27017/mydrive
|
||||
|
||||
# Directory paths need to end with a slash
|
||||
DB_TYPE=fs
|
||||
FS_DIRECTORY=/data/
|
||||
TEMP_DIRECTORY=/temp/
|
||||
|
||||
KEY=encryptionkey
|
||||
PASSWORD_ACCESS=secretaccesspassword
|
||||
PASSWORD_REFRESH=secretrefreshpassword
|
||||
PASSWORD_COOKIE=secretcookiepassword
|
||||
|
||||
VIDEO_THUMBNAILS_ENABLED=true
|
||||
TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000
|
||||
|
||||
# S3
|
||||
S3_ID=
|
||||
S3_KEY=
|
||||
S3_BUCKET=
|
||||
|
||||
# Change app internal ports
|
||||
HTTP_PORT=
|
||||
HTTPS_PORT=
|
||||
|
||||
URL=
|
||||
|
||||
# Email
|
||||
EMAIL_VERIFICATION=
|
||||
EMAIL_DOMAIN=
|
||||
EMAIL_ADDRESS=
|
||||
EMAIL_API_KEY=
|
||||
EMAIL_HOST=
|
||||
|
||||
REMOTE_URL=
|
||||
SECURE_COOKIES=
|
||||
SSL=
|
||||
|
||||
# Block account creation. Do this after creating the required accounts
|
||||
BLOCK_CREATE_ACCOUNT=true
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Docker Build and Push frontend dev
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-push-dev:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Setup QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
id: qemu
|
||||
with:
|
||||
platforms: amd64,arm64
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log into ghcr.io registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build Docker Metadata
|
||||
id: docker-metadata
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/subnub/mydrive
|
||||
docker.io/kylehoell/mydrive
|
||||
flavor: |
|
||||
latest=auto
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=sha,commit=${{ github.sha }}
|
||||
type=raw,value=dev,enable={{is_default_branch}}
|
||||
|
||||
- name: Push Service Image to repo
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
provenance: mode=max
|
||||
tags: ${{ steps.docker-metadata.outputs.tags }}
|
||||
labels: ${{ steps.docker-metadata.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha,scope=${{ github.workflow }}
|
||||
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||
@@ -0,0 +1,69 @@
|
||||
name: Docker Build and Push frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker Setup QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
id: qemu
|
||||
with:
|
||||
platforms: amd64,arm64
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log into ghcr.io registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build Docker Metadata
|
||||
id: docker-metadata
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
ghcr.io/subnub/mydrive
|
||||
docker.io/kylehoell/mydrive
|
||||
flavor: |
|
||||
latest=auto
|
||||
tags: |
|
||||
type=ref,event=tag
|
||||
type=sha,commit=${{ github.sha }}
|
||||
type=semver,pattern={{version}}
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
|
||||
- name: Push Service Image to repo
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
provenance: mode=max
|
||||
tags: ${{ steps.docker-metadata.outputs.tags }}
|
||||
labels: ${{ steps.docker-metadata.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64
|
||||
cache-from: type=gha,scope=${{ github.workflow }}
|
||||
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||
@@ -0,0 +1,20 @@
|
||||
name: 'Release Please'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: googleapis/release-please-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
release-type: node
|
||||
@@ -7,6 +7,7 @@ config/.env.development
|
||||
config/.env.test
|
||||
config/.env.production
|
||||
config/.env.test
|
||||
.env
|
||||
.env.development
|
||||
.env.test
|
||||
.env.production
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: mydrive
|
||||
volumes:
|
||||
# Use the following volumes section if you want to use bind mounts:
|
||||
# - /path/to/data:/data/
|
||||
# - /path/to/temp:/temp/
|
||||
|
||||
# Use the following volumes section if you want to use named volumes:
|
||||
- mydrive-data:/data/
|
||||
- mydrive-temp:/temp/
|
||||
ports:
|
||||
- "${HTTP_PORT:-3000}:3000"
|
||||
- "${HTTPS_PORT:-8080}:8080"
|
||||
env_file:
|
||||
- .env.test # Copy .env.example to .env.test or .env and fill in the values
|
||||
|
||||
# Use the following volumes section if you want to use named volumes. Useful for development.
|
||||
volumes:
|
||||
mydrive-data:
|
||||
mydrive-temp:
|
||||
+5
-31
@@ -1,39 +1,13 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: mydrive
|
||||
image: mydrive-image
|
||||
image: kylehoell/mydrive:latest
|
||||
volumes:
|
||||
- /user/example/:/data
|
||||
- /path/to/data:/data/
|
||||
- /path/to/temp:/temp/
|
||||
ports:
|
||||
- "${HTTP_PORT:-3000}:3000"
|
||||
- "${HTTPS_PORT:-8080}:8080"
|
||||
environment:
|
||||
- DOCKER=true
|
||||
- MONGODB_URL=
|
||||
- DB_TYPE=
|
||||
- FS_DIRECTORY=/data # Change this if you change the volume
|
||||
- S3_ID=
|
||||
- S3_KEY=
|
||||
- S3_BUCKET=
|
||||
- KEY=
|
||||
- HTTP_PORT=
|
||||
- HTTPS_PORT=
|
||||
- URL=
|
||||
- EMAIL_VERIFICATION=
|
||||
- EMAIL_DOMAIN=
|
||||
- EMAIL_ADDRESS=
|
||||
- EMAIL_API_KEY=
|
||||
- EMAIL_HOST=
|
||||
- REMOTE_URL=
|
||||
- PASSWORD_ACCESS=
|
||||
- PASSWORD_REFRESH=
|
||||
- PASSWORD_COOKIE=
|
||||
- VIDEO_THUMBNAILS_ENABLED=
|
||||
- TEMP_DIRECTORY=
|
||||
- TEMP_VIDEO_THUMBNAIL_LIMIT=
|
||||
- SECURE_COOKIES=
|
||||
- SSL=
|
||||
env_file:
|
||||
- .env # Copy .env.example to .env and fill in the values
|
||||
Reference in New Issue
Block a user