Skip to content

Commit

Permalink
add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
WeeJeWel committed Jul 31, 2024
1 parent 5816a19 commit e0fa626
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/
/.env
/.envrc
/backups/
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:lts

RUN mkdir /app
WORKDIR /app

COPY ./bin/ /app/bin/
COPY ./lib/ /app/lib/
COPY ./index.mjs /app/
COPY ./package.json /app/
COPY ./package-lock.json /app/

RUN npm ci

CMD npm start
1 change: 0 additions & 1 deletion bin/google-backup.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node

import fs from 'fs';
import path from 'path';

import { program } from 'commander';
import GoogleBackup from '../lib/GoogleBackup.mjs';
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
google-backup:
image: google-backup
build:
context: .
dockerfile: Dockerfile
environment:
- GOOGLE_BACKUP_USERNAME
- GOOGLE_BACKUP_PASSWORD
- GOOGLE_BACKUP_FILEPATH=/backups/
volumes:
- ./backups:/backups
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"version": "1.0.1",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node ./bin/google-backup.mjs",
"build:docker": "docker build -t google-backup .",
"start:docker": "docker compose up"
},
"bin": {
"google-backup": "./bin/google-backup.mjs"
Expand All @@ -20,4 +23,4 @@
"tsdav": "^2.1.0",
"vcard-parser": "^1.0.0"
}
}
}

0 comments on commit e0fa626

Please sign in to comment.