Skip to content

Commit f68730a

Browse files
committed
previous state
1 parent 13504f9 commit f68730a

2 files changed

Lines changed: 22 additions & 34 deletions

File tree

Dockerfile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
ARG NODE_VERSION=22.17.0
66
FROM node:${NODE_VERSION}-slim AS base
77

8+
LABEL fly_launch_runtime="Node.js"
9+
810
# Node.js app lives here
911
WORKDIR /app
1012

@@ -16,35 +18,34 @@ ARG PNPM_VERSION=10.13.0
1618
RUN npm install -g pnpm@$PNPM_VERSION
1719

1820

21+
# Throw-away build stage to reduce size of final image
22+
FROM base AS build
23+
1924
# Install packages needed to build node modules
2025
RUN apt-get update -qq && \
2126
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 git
2227

23-
# Dependencies stage
24-
FROM base AS dependencies
28+
# Install node modules
2529
COPY .npmrc package.json pnpm-lock.yaml ./
26-
RUN pnpm install --frozen-lockfile
30+
RUN pnpm install --frozen-lockfile --prod=false
2731

28-
# Build stage
29-
FROM dependencies AS build
32+
# Copy application code
3033
COPY . .
34+
35+
# Build application
3136
RUN pnpm run generate:docs
3237
RUN pnpm run build
3338

34-
35-
# Final production stage
39+
# Remove development dependencies
3640
RUN pnpm prune --prod
37-
FROM base
38-
WORKDIR /app
39-
ENV NODE_ENV=production
4041

4142

42-
# Copy production dependencies
43-
COPY --from=build /app/node_modules /app/node_modules
44-
COPY --from=build /app/build /app/build
45-
COPY --from=build /app/generated-docs /app/generated-docs
43+
# Final stage for app image
44+
FROM base
4645

46+
# Copy built application
47+
COPY --from=build /app /app
4748

4849
# Start the server by default, this can be overwritten at runtime
49-
EXPOSE 8080
50+
EXPOSE 3000
5051
CMD [ "pnpm", "run", "start" ]

fly.toml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
1-
# fly.toml app configuration file generated for docs-template-test on 2025-09-15T13:34:48+02:00
1+
# fly.toml app configuration file generated for docs-template-test on 2025-09-12T12:27:12+02:00
22
#
33
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
44
#
55

66
app = 'docs-template-test'
77
primary_region = 'fra'
8-
kill_signal = 'SIGINT'
9-
kill_timeout = '5s'
108

119
[build]
1210

13-
[deploy]
14-
strategy = 'bluegreen'
15-
wait_timeout = '15m0s'
16-
1711
[http_service]
18-
internal_port = 8080
12+
internal_port = 3000
1913
force_https = true
20-
auto_stop_machines = 'suspend'
14+
auto_stop_machines = 'stop'
2115
auto_start_machines = true
2216
min_machines_running = 0
23-
24-
[[services.http_checks]]
25-
interval = '10s'
26-
timeout = '2s'
27-
grace_period = '5s'
28-
method = 'GET'
29-
path = '/'
30-
protocol = 'http'
17+
processes = ['app']
3118

3219
[[vm]]
3320
memory = '512mb'
34-
size = 'shared-cpu-1x'
35-
processes = ['app']
21+
cpu_kind = 'shared'
22+
cpus = 1

0 commit comments

Comments
 (0)