Skip to content

Commit 12f829e

Browse files
committed
add fly conf
1 parent 818140c commit 12f829e

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.dockerignore

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

Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM debian:bullseye as builder
2+
3+
ARG NODE_VERSION=19.7.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+
ENV PORT 8080
36+
37+
CMD [ "npm", "run", "start" ]

fly.toml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# fly.toml file generated for y-webrtc-eu on 2023-03-16T15:02:47+01:00
2+
3+
app = "y-webrtc-eu"
4+
kill_signal = "SIGINT"
5+
kill_timeout = 5
6+
processes = []
7+
8+
[env]
9+
10+
[experimental]
11+
auto_rollback = true
12+
13+
[[services]]
14+
http_checks = []
15+
internal_port = 8080
16+
processes = ["app"]
17+
protocol = "tcp"
18+
script_checks = []
19+
[services.concurrency]
20+
hard_limit = 25
21+
soft_limit = 20
22+
type = "connections"
23+
24+
[[services.ports]]
25+
force_https = true
26+
handlers = ["http"]
27+
port = 80
28+
29+
[[services.ports]]
30+
handlers = ["tls", "http"]
31+
port = 443
32+
33+
[[services.tcp_checks]]
34+
grace_period = "1s"
35+
interval = "15s"
36+
restart_limit = 0
37+
timeout = "2s"

0 commit comments

Comments
 (0)