Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] - Make the theme deployable to Fly.io #114

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/node_modules
*.log
.DS_Store
/.cache
.git
/dist
/.shopify
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is moved to the root directory before building the image

# base node image
FROM node:20-bookworm-slim as base
RUN apt-get update && apt-get install -y openssl ca-certificates

# Build the app
FROM base as build

WORKDIR /myapp
ADD . .
RUN npm install --package-lock=false

RUN npx --yes patch-package

# Finally, build the production image with minimal footprint
RUN npm run build

FROM base


WORKDIR /myapp

ENV NODE_ENV=production
ENV FLY="true"
ENV PORT="8080"

COPY --from=build /myapp/node_modules /myapp/node_modules

COPY --from=build /myapp/dist /myapp/dist


ADD . .
EXPOSE 8080

CMD ["npm", "run", "start"]
22 changes: 22 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# fly.toml app configuration file generated for pilot-purple-snowflake-481 on 2024-05-14T14:03:19+07:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'pilot'
primary_region = 'sin'

[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 = '512mb'
cpu_kind = 'shared'
cpus = 1
Loading