Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ffc41e4

Browse files
author
Fly.io
committed
New files from Fly.io Launch
1 parent fedee1f commit ffc41e4

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

‎backend/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.git
2+
/node_modules
3+
.dockerignore
4+
.env
5+
Dockerfile
6+
fly.toml

‎backend/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Adjust NODE_VERSION as desired
4+
ARG NODE_VERSION=20.18.0
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+
16+
# Throw-away build stage to reduce size of final image
17+
FROM base AS build
18+
19+
# Install packages needed to build node modules
20+
RUN apt-get update -qq && \
21+
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
22+
23+
# Install node modules
24+
COPY package-lock.json package.json ./
25+
RUN npm ci --include=dev
26+
27+
# Copy application code
28+
COPY . .
29+
30+
# Build application
31+
RUN npm run build
32+
33+
# Remove development dependencies
34+
RUN npm prune --omit=dev
35+
36+
37+
# Final stage for app image
38+
FROM base
39+
40+
# Copy built application
41+
COPY --from=build /app /app
42+
43+
# Start the server by default, this can be overwritten at runtime
44+
EXPOSE 3000
45+
CMD [ "npm", "run", "start" ]

‎backend/fly.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# fly.toml app configuration file generated for quicksnip on 2025年07月02日T13:29:43Z
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app = 'quicksnip'
7+
primary_region = 'arn'
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
23+
memory_mb = 1024

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /