commit d2080c7fe3f9fac2df9b981ff80ce261f1b38360
Author: Frederic Desgreniers <fredericdesgreniers@gmail.com>
Date: Sun Feb 25 10:29:09 2024 -0500
Add fly.io deploy config
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..a2274d8
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,23 @@
dist
worker
.solid
.vercel
.output
.vinxi
# dependencies
/node_modules
# IDEs and editors
/.idea
.project
.classpath
*.launch
.settings/
# Temp
gitignore
# System Files
.DS_Store
Thumbs.db
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..c467b2d
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,49 @@
# syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=21.6.1
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="Node.js"
# Node.js app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV="production"
# Install pnpm
ARG PNPM_VERSION=8.15.4
RUN npm install -g pnpm@$PNPM_VERSION
# Throw-away build stage to reduce size of final image
FROM base as build
# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
# Install node modules
COPY --link package.json pnpm-lock.yaml yarn.lock ./
RUN pnpm install --frozen-lockfile --prod=false
# Copy application code
COPY --link . .
# Build application
RUN pnpm run build
# Remove development dependencies
RUN pnpm prune --prod
# Final stage for app image
FROM base
# Copy built application
COPY --from=build /app /app
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "pnpm", "run", "start" ]
diff --git a/fly.toml b/fly.toml
new file mode 100644
index 0000000..f428faa
--- /dev/null
+++ b/fly.toml
@@ -0,0 +1,22 @@
# fly.toml app configuration file generated for frde-me on 2024-02-25T10:18:33-05:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#
app = 'frde-me'
primary_region = 'yul'
[build]
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
diff --git a/package.json b/package.json
index 1a22508..9abbf8f 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"type": "module",
"private": true,
"devDependencies": {
"@flydotio/dockerfile": "^0.5.2",
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"solid-start-vercel": "^0.2.32",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 94908ef..3905b5d 100644