Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

add fly stuff

Sara Vieira5029a964ff16
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000..709870d923
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,7 @@
+/node_modules
+*.log
+.DS_Store
+.env
+/.cache
+/public/build
+/build
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..6c10e08696
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,59 @@
+# base node image
+FROM node:16-bullseye-slim as base
+
+# set for base and all layer that inherit from it
+ENV NODE_ENV production
+
+# Install openssl for Prisma
+RUN apt-get update && apt-get install -y openssl sqlite3
+
+# Install all node_modules, including dev dependencies
+FROM base as deps
+
+WORKDIR /myapp
+
+ADD package.json package-lock.json ./
+RUN npm install --production=false
+
+# Setup production node_modules
+FROM base as production-deps
+
+WORKDIR /myapp
+
+COPY --from=deps /myapp/node_modules /myapp/node_modules
+ADD package.json package-lock.json ./
+RUN npm prune --production
+
+# Build the app
+FROM base as build
+
+WORKDIR /myapp
+
+COPY --from=deps /myapp/node_modules /myapp/node_modules
+
+ADD prisma .
+RUN npx prisma generate
+
+ADD . .
+RUN npm run build
+
+# Finally, build the production image with minimal footprint
+FROM base
+
+ENV DATABASE_URL=file:/data/sqlite.db
+ENV PORT="8080"
+ENV NODE_ENV="production"
+
+# add shortcut for connecting to database CLI
+RUN echo "#!/bin/sh\nset -x\nsqlite3 \$DATABASE_URL" > /usr/local/bin/database-cli && chmod +x /usr/local/bin/database-cli
+
+WORKDIR /myapp
+
+COPY --from=production-deps /myapp/node_modules /myapp/node_modules
+COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma
+
+COPY --from=build /myapp/build /myapp/build
+COPY --from=build /myapp/public /myapp/public
+ADD . .
+
+CMD ["npm", "start"]
\ No newline at end of file
diff --git a/fly-toml b/fly-toml
new file mode 100644
index 0000000000..2eb518d4c7
--- /dev/null
+++ b/fly-toml
@@ -0,0 +1,51 @@
+app = "webstudio.is"
+
+kill_signal = "SIGINT"
+kill_timeout = 5
+processes = []
+
+[experimental]
+ allowed_public_ports = []
+ auto_rollback = true
+ cmd = "start.sh"
+ entrypoint = "sh"
+
+[mounts]
+ source = "data"
+ destination = "/data"
+
+[[services]]
+ internal_port = 8080
+ processes = ["app"]
+ protocol = "tcp"
+ script_checks = []
+
+ [services.concurrency]
+ hard_limit = 25
+ soft_limit = 20
+ type = "connections"
+
+ [[services.ports]]
+ handlers = ["http"]
+ port = 80
+ force_https = true
+
+ [[services.ports]]
+ handlers = ["tls", "http"]
+ port = 443
+
+ [[services.tcp_checks]]
+ grace_period = "1s"
+ interval = "15s"
+ restart_limit = 0
+ timeout = "2s"
+
+ [[services.http_checks]]
+ interval = 10000
+ grace_period = "5s"
+ method = "get"
+ path = "/healthcheck"
+ protocol = "http"
+ timeout = 2000
+ tls_skip_verify = false
+ [services.http_checks.headers]
\ No newline at end of file