Skip to content

Commit 8e6115d

Browse files
committed
move deployment to fly.io
1 parent 1589803 commit 8e6115d

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Dockerfile
2+
.dockerignore
3+
node_modules
4+
.git
5+
.env

Dockerfile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
FROM debian:bullseye as builder
2+
3+
ARG NODE_VERSION=18.9.0
4+
5+
RUN apt-get update; apt install -y curl
6+
RUN curl https://get.volta.sh | bash
7+
ENV VOLTA_HOME /root/.volta
8+
ENV PATH /root/.volta/bin:$PATH
9+
RUN volta install node@${NODE_VERSION}
10+
11+
#######################################################################
12+
13+
RUN mkdir /app
14+
WORKDIR /app
15+
16+
# NPM will not install any package listed in "devDependencies" when NODE_ENV is set to "production",
17+
# to install all modules: "npm install --production=false".
18+
# Ref: https://docs.npmjs.com/cli/v9/commands/npm-install#description
19+
20+
ENV NODE_ENV production
21+
22+
COPY . .
23+
24+
RUN npm install
25+
FROM debian:bullseye
26+
27+
LABEL fly_launch_runtime="nodejs"
28+
29+
COPY --from=builder /root/.volta /root/.volta
30+
COPY --from=builder /app /app
31+
32+
WORKDIR /app
33+
ENV NODE_ENV production
34+
ENV PATH /root/.volta/bin:$PATH
35+
36+
CMD [ "npm", "run", "start" ]

Procfile

-2
This file was deleted.

fly.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# fly.toml file generated for discord-ascii-bot on 2022-11-22T22:39:51+01:00
2+
3+
app = "discord-ascii-bot"
4+
kill_signal = "SIGINT"
5+
kill_timeout = 5
6+
processes = []
7+
8+
[env]
9+
PORT = "8080"
10+
11+
[experimental]
12+
allowed_public_ports = []
13+
auto_rollback = true

0 commit comments

Comments
 (0)