Skip to content

Commit

Permalink
Updated docker-compose files
Browse files Browse the repository at this point in the history
  • Loading branch information
planecore committed Oct 20, 2020
1 parent f7ebdbd commit c0ad1bc
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 18 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,3 @@ yarn-error.log*

# vercel
.vercel

# compose
docker-compose-dev.yml
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"type": "shell",
"command": "docker-compose -f docker-compose-dev.yml up --build",
"command": "docker-compose -f docker-compose-dev.yml --env-file .env.local up --build",
"problemMatcher": [],
"label": "Docker",
"detail": "Builds and runs a docker container"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Fill the BOT_TOKEN, leave CHAT_ID empty and start the container.
version: "3"
services:
notifybot:
container_name: notifybot
image: planecore/notifybot
ports:
- "3000:3000"
Expand Down
13 changes: 13 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"
services:
notifybot:
container_name: notifybot
build: .
ports:
- "3000:3000"
environment:
- BOT_TOKEN
- CHAT_ID
volumes:
- ./db:/usr/src/app/db
restart: unless-stopped
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"
services:
notifybot:
container_name: notifybot
build: .
image: planecore/notifybot
ports:
- "3000:3000"
environment:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notifybot",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
30 changes: 19 additions & 11 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const HomePage: NextPage<HomePageProps> = ({ messages }) => {
const router = useRouter()
const [, setToast] = useToasts()
const [message, setMessage] = useState("")
const [showDatePicker, setShowDatePicker] = useState(false)
const [scheduleDate, setScheduleDate] = useState<Date>(new Date())
const [shouldSchedule, setShouldSchedule] = useState<"true" | "false">(
"false"
Expand Down Expand Up @@ -73,29 +74,36 @@ const HomePage: NextPage<HomePageProps> = ({ messages }) => {
<Tabs.Item label="Send Now" value="false" />
<Tabs.Item label="Send Later" value="true">
<div style={{ height: 40 }}>
<div style={{ position: "absolute" }}>
<Button type="secondary" ghost>
{scheduleDate.toLocaleString("en-US", {
month: "short",
day: "numeric",
hour: "numeric",
minute: "2-digit",
})}
</Button>
</div>
<div style={{ position: "absolute" }}>
<MuiPickersUtilsProvider utils={DayJSUtils}>
<DateTimePicker
value={scheduleDate}
inputVariant="outlined"
style={{ height: 40, width: 200, opacity: 0, zIndex: 50 }}
style={{ height: 40, width: 200, opacity: 0 }}
onChange={(date) => setScheduleDate(date.toDate())}
open={showDatePicker}
onOpen={() => setShowDatePicker(true)}
onClose={() => setShowDatePicker(false)}
ampm={false}
autoOk
disablePast
/>
</MuiPickersUtilsProvider>
</div>
<div style={{ position: "absolute" }}>
<Button
type="secondary"
ghost
onClick={() => setShowDatePicker(true)}
>
{scheduleDate.toLocaleString("en-US", {
month: "short",
day: "numeric",
hour: "numeric",
minute: "2-digit",
})}
</Button>
</div>
</div>
</Tabs.Item>
</Tabs>
Expand Down
1 change: 0 additions & 1 deletion src/scheduleJobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ if (chatId === undefined || chatId === "") {

function scheduleJob() {
schedule.scheduleJob("* * * * *", async () => {
console.log("HELLO AT ", new Date())
sendMessagesInQueue()
})
}
Expand Down

0 comments on commit c0ad1bc

Please sign in to comment.