Skip to content

Commit 0607306

Browse files
committed
init project
0 parents  commit 0607306

8 files changed

+2576
-0
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.env

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.env

Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Adjust NODE_VERSION as desired
4+
ARG NODE_VERSION=18.20.4
5+
FROM node:${NODE_VERSION}-slim as base
6+
7+
LABEL fly_launch_runtime="Node.js"
8+
9+
# Node.js app lives here
10+
WORKDIR /app
11+
12+
# Set production environment
13+
ENV NODE_ENV="production"
14+
15+
# Install pnpm
16+
ARG PNPM_VERSION=9.14.4
17+
RUN npm install -g pnpm@$PNPM_VERSION
18+
19+
20+
# Throw-away build stage to reduce size of final image
21+
FROM base as build
22+
23+
# Install packages needed to build node modules
24+
RUN apt-get update -qq && \
25+
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
26+
27+
# Install node modules
28+
COPY package.json pnpm-lock.yaml ./
29+
RUN pnpm install --frozen-lockfile --prod=false
30+
31+
# Copy application code
32+
COPY . .
33+
34+
# Build application
35+
RUN pnpm run build
36+
37+
# Remove development dependencies
38+
RUN pnpm prune --prod
39+
40+
41+
# Final stage for app image
42+
FROM base
43+
44+
# Copy built application
45+
COPY --from=build /app /app
46+
47+
# Start the server by default, this can be overwritten at runtime
48+
EXPOSE 3000
49+
CMD [ "pnpm", "run", "start" ]

fly.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# fly.toml app configuration file generated for slack-bot-patient-morning-391 on 2024-12-10T21:52:21+09:00
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'slack-bot-patient-morning-391'
7+
primary_region = 'sin'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port = 3000
13+
force_https = true
14+
auto_stop_machines = 'stop'
15+
auto_start_machines = true
16+
min_machines_running = 0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory = '1gb'
21+
cpu_kind = 'shared'
22+
cpus = 1

package.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "slack-bot",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1",
8+
"build": "tsc",
9+
"start": "node dist/app.js",
10+
"dev": "ts-node src/app.ts"
11+
},
12+
"keywords": [],
13+
"author": "",
14+
"license": "ISC",
15+
"dependencies": {
16+
"@slack/bolt": "^4.1.1",
17+
"@slack/events-api": "^3.0.1",
18+
"@supabase/supabase-js": "^2.47.3",
19+
"dotenv": "^16.4.7",
20+
"express": "^4.21.2",
21+
"open-graph-scraper": "^6.8.3"
22+
},
23+
"devDependencies": {
24+
"@flydotio/dockerfile": "^0.5.9",
25+
"@types/express": "^5.0.0",
26+
"@types/node": "^22.10.1",
27+
"nodemon": "^3.1.7",
28+
"ts-node": "^10.9.2",
29+
"typescript": "^5.7.2"
30+
}
31+
}

0 commit comments

Comments
 (0)