Skip to content

Commit dfe5ac8

Browse files
authored
Merge pull request #75 from AyushSehrawat/docker-setup
chore: Add docker image workflow and release-please
2 parents 8da5241 + 18c2764 commit dfe5ac8

File tree

10 files changed

+251
-32
lines changed

10 files changed

+251
-32
lines changed

.dockerignore

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
node_modules
1+
.git/
2+
.gitignore
3+
.dockerignore
4+
docker-compose*
5+
Dockerfile
6+
makefile
7+
htmlcov/
8+
coverage.xml
9+
.coverage*
10+
11+
.vscode/
12+
*.dat
13+
14+
.DS_Store
15+
node_modules
16+
/build
17+
/package
18+
.env
19+
.env.*
20+
!.env.example
21+
vite.config.js.timestamp-*
22+
vite.config.ts.timestamp-*
23+
.idea

.env.example

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
DOCKER=true
2+
3+
MONGODB_URL=mongodb://127.0.0.1:27017/mydrive
4+
5+
# Directory paths need to end with a slash
6+
DB_TYPE=fs
7+
FS_DIRECTORY=/data/
8+
TEMP_DIRECTORY=/temp/
9+
10+
KEY=encryptionkey
11+
PASSWORD_ACCESS=secretaccesspassword
12+
PASSWORD_REFRESH=secretrefreshpassword
13+
PASSWORD_COOKIE=secretcookiepassword
14+
15+
VIDEO_THUMBNAILS_ENABLED=true
16+
TEMP_VIDEO_THUMBNAIL_LIMIT=5000000000
17+
18+
# S3
19+
S3_ID=
20+
S3_KEY=
21+
S3_BUCKET=
22+
23+
# Change app internal ports
24+
HTTP_PORT=
25+
HTTPS_PORT=
26+
27+
URL=
28+
29+
# Email
30+
EMAIL_VERIFICATION=
31+
EMAIL_DOMAIN=
32+
EMAIL_ADDRESS=
33+
EMAIL_API_KEY=
34+
EMAIL_HOST=
35+
36+
REMOTE_URL=
37+
SECURE_COOKIES=
38+
SSL=
39+
40+
# Block account creation. Do this after creating the required accounts
41+
BLOCK_CREATE_ACCOUNT=true
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker Build and Push frontend dev
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-push-dev:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
packages: write
14+
security-events: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Docker Setup QEMU
21+
uses: docker/setup-qemu-action@v3
22+
id: qemu
23+
with:
24+
platforms: amd64,arm64
25+
26+
- name: Set up Docker Buildx
27+
uses: docker/setup-buildx-action@v3
28+
29+
- name: Log into ghcr.io registry
30+
uses: docker/login-action@v3
31+
with:
32+
registry: ghcr.io
33+
username: ${{ github.repository_owner }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Log in to Docker Hub
37+
uses: docker/login-action@v3
38+
with:
39+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
40+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
41+
42+
- name: Build Docker Metadata
43+
id: docker-metadata
44+
uses: docker/metadata-action@v5
45+
with:
46+
images: |
47+
ghcr.io/subnub/mydrive
48+
docker.io/kylehoell/mydrive
49+
flavor: |
50+
latest=auto
51+
tags: |
52+
type=ref,event=branch
53+
type=sha,commit=${{ github.sha }}
54+
type=raw,value=dev,enable={{is_default_branch}}
55+
56+
- name: Push Service Image to repo
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
file: ./Dockerfile
61+
push: true
62+
provenance: mode=max
63+
tags: ${{ steps.docker-metadata.outputs.tags }}
64+
labels: ${{ steps.docker-metadata.outputs.labels }}
65+
platforms: linux/amd64,linux/arm64
66+
cache-from: type=gha,scope=${{ github.workflow }}
67+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

.github/workflows/docker-build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docker Build and Push frontend
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-push:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
packages: write
15+
security-events: write
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Docker Setup QEMU
22+
uses: docker/setup-qemu-action@v3
23+
id: qemu
24+
with:
25+
platforms: amd64,arm64
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Log into ghcr.io registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.repository_owner }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Log in to Docker Hub
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
41+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
42+
43+
- name: Build Docker Metadata
44+
id: docker-metadata
45+
uses: docker/metadata-action@v5
46+
with:
47+
images: |
48+
ghcr.io/subnub/mydrive
49+
docker.io/kylehoell/mydrive
50+
flavor: |
51+
latest=auto
52+
tags: |
53+
type=ref,event=tag
54+
type=sha,commit=${{ github.sha }}
55+
type=semver,pattern={{version}}
56+
type=raw,value=latest,enable={{is_default_branch}}
57+
58+
- name: Push Service Image to repo
59+
uses: docker/build-push-action@v5
60+
with:
61+
context: .
62+
file: ./Dockerfile
63+
push: true
64+
provenance: mode=max
65+
tags: ${{ steps.docker-metadata.outputs.tags }}
66+
labels: ${{ steps.docker-metadata.outputs.labels }}
67+
platforms: linux/amd64,linux/arm64
68+
cache-from: type=gha,scope=${{ github.workflow }}
69+
cache-to: type=gha,mode=max,scope=${{ github.workflow }}

.github/workflows/release-please.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Release Please'
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
release-please:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: googleapis/release-please-action@v4
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
release-type: node

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config/.env.development
77
config/.env.test
88
config/.env.production
99
config/.env.test
10+
.env
1011
.env.development
1112
.env.test
1213
.env.production

CHANGELOG.md

Whitespace-only changes.

readme.md renamed to README.md

File renamed without changes.

docker-compose-test.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "3.8"
2+
services:
3+
app:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
container_name: mydrive
8+
volumes:
9+
# Use the following volumes section if you want to use bind mounts:
10+
# - /path/to/data:/data/
11+
# - /path/to/temp:/temp/
12+
13+
# Use the following volumes section if you want to use named volumes:
14+
- mydrive-data:/data/
15+
- mydrive-temp:/temp/
16+
ports:
17+
- "${HTTP_PORT:-3000}:3000"
18+
- "${HTTPS_PORT:-8080}:8080"
19+
env_file:
20+
- .env.test # Copy .env.example to .env.test or .env and fill in the values
21+
22+
# Use the following volumes section if you want to use named volumes. Useful for development.
23+
volumes:
24+
mydrive-data:
25+
mydrive-temp:

docker-compose.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,13 @@
11
version: "3.8"
22
services:
33
app:
4-
build:
5-
context: .
6-
dockerfile: Dockerfile
74
container_name: mydrive
8-
image: mydrive-image
5+
image: kylehoell/mydrive:latest
96
volumes:
10-
- /user/example/:/data
7+
- /path/to/data:/data/
8+
- /path/to/temp:/temp/
119
ports:
1210
- "${HTTP_PORT:-3000}:3000"
1311
- "${HTTPS_PORT:-8080}:8080"
14-
environment:
15-
- DOCKER=true
16-
- MONGODB_URL=
17-
- DB_TYPE=
18-
- FS_DIRECTORY=/data # Change this if you change the volume
19-
- S3_ID=
20-
- S3_KEY=
21-
- S3_BUCKET=
22-
- KEY=
23-
- HTTP_PORT=
24-
- HTTPS_PORT=
25-
- URL=
26-
- EMAIL_VERIFICATION=
27-
- EMAIL_DOMAIN=
28-
- EMAIL_ADDRESS=
29-
- EMAIL_API_KEY=
30-
- EMAIL_HOST=
31-
- REMOTE_URL=
32-
- PASSWORD_ACCESS=
33-
- PASSWORD_REFRESH=
34-
- PASSWORD_COOKIE=
35-
- VIDEO_THUMBNAILS_ENABLED=
36-
- TEMP_DIRECTORY=
37-
- TEMP_VIDEO_THUMBNAIL_LIMIT=
38-
- SECURE_COOKIES=
39-
- SSL=
12+
env_file:
13+
- .env # Copy .env.example to .env and fill in the values

0 commit comments

Comments
 (0)