open-index/open-npm huggingface dataset:
npm package: @lowdefy/server-docker
Description: The [official Lowdefy Docker](https://hub.docker.com/repository/docker/lowdefy/lowdefy) images can be found on Docker Hub.
Latest version: 3.23.3

# @lowdefy/server-docker

The [official Lowdefy Docker](https://hub.docker.com/repository/docker/lowdefy/lowdefy) images can be found on Docker Hub.

Examples of Docker configuration can be found in the [example repository](https://github.com/lowdefy/lowdefy-example-docker).

The Lowdefy Docker images contain a Lowdefy server. The configuration of the Lowdefy app can either be built into a new image based on the Lowdefy image, or the configuration read from the file system, usually provided as a volume.

The Lowdefy server can be configured using the following environment variables:

- `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./build` (or `/home/node/lowdefy/build`).
- `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public` (or `/home/node/lowdefy/public`).
- `LOWDEFY_SERVER_PORT`: The port (inside the container) at which to run the server. The default is `3000`.

> When updating your app to a new Lowdefy version, make sure to update the Lowdefy version in the Dockerfile

# Building a Lowdefy app image

To build the configuration into an image, the following Dockerfile can be used:

```text
FROM node:14-buster AS build

# Set working directory and node user
WORKDIR /home/node/lowdefy

RUN chown node:node /home/node/lowdefy

USER node

# Copy app config and change ownership of files to "node" user
COPY  --chown=node:node  . .

# Build the Lowdefy config using the Lowdefy CLI
RUN npx lowdefy@3.21.2 build

# Use the correct Lowdefy base image
FROM lowdefy/lowdefy:3.21.2

# Copy build output from build stage
COPY --from=build --chown=node:node /home/node/lowdefy/.lowdefy/build ./build

# Copy contents of public directory into image
COPY --chown=node:node ./public ./public

# Run the server on start
CMD ["node", "./dist/server.js"]
```

with a `.dockerignore` file:

```
.lowdefy/**
.env
```

An image can be built by running:

```
docker build -t <tag> .
```

The container can be run by:

```
docker run -p 3000:3000 <tag>
```

Docker compose can also be used. Use a `docker-compose.yaml` file:

```
version: "3.8"
services:
  lowdefy:
    build: .
    ports:
      - "3000:3000"
```

To build the image, run:

```
docker compose build
```

To run the app, run:

```
docker compose up
```

## More Lowdefy resources

- Getting started with Lowdefy - https://docs.lowdefy.com/tutorial-start
- Lowdefy docs - https://docs.lowdefy.com
- Lowdefy website - https://lowdefy.com
- Community forum - https://github.com/lowdefy/lowdefy/discussions
- Bug reports and feature requests - https://github.com/lowdefy/lowdefy/issues

## Licence

[Apache-2.0](https://github.com/lowdefy/lowdefy/blob/main/LICENSE)
npm package: @lowdefy/server-netlify
Description: A Lowdefy server that runs on [Netlify](https://www.netlify.com).
Latest version: 3.23.3

# @lowdefy/server-netlify

A Lowdefy server that runs on [Netlify](https://www.netlify.com).

## Deploying to Netlify

#### Step 1

Your project will need to be hosted as a Github repository.

#### Step 2

Link your Github project to Netlify.

- Once logged in to Netlify, click the "New site from git" button.
- Choose Github, and authorise Netlify to access your repositories.
- Select your repository.

> If your repository isn't found, click "Configure Netlify on Github", and give Netlify access to your repository.

#### Step 3

Configure your Netlify deployment.

- Set your build command to `npx lowdefy@3 build-netlify`.
- Set your publish directory to `.lowdefy/publish`.
- Review the other settings, and deploy your site.

> Your site won't work yet. You first need to configure the Lowdefy server in the next step.

#### Step 4

Configure the Lowdefy server.

- Click the "Site settings" button.
- Choose the "Functions" section in the left menu.
- Edit the settings and set your functions directory to `.lowdefy/functions`.

#### Step 5

Redeploy your site.

- Go to the "Deploys" tab.
- Click the "Trigger deploy" button and deploy your site.
- Wait for you site to finish deploying.

On the "Site overview" tab you will find your site url.

## More Lowdefy resources

- Getting started with Lowdefy - https://docs.lowdefy.com/tutorial-start
- Lowdefy docs - https://docs.lowdefy.com
- Lowdefy website - https://lowdefy.com
- Community forum - https://github.com/lowdefy/lowdefy/discussions
- Bug reports and feature requests - https://github.com/lowdefy/lowdefy/issues

## Licence

[Apache-2.0](https://github.com/lowdefy/lowdefy/blob/main/LICENSE)
npm package: @lowdefy/server-node
Description: A production Lowdefy server that runs using Node.js is published on npm as [@lowdefy/server-node](https://www.npmjs.com/package/@lowdefy/server-node).
Latest version: 3.23.3

# @lowdefy/server-node

A production Lowdefy server that runs using Node.js is published on npm as [@lowdefy/server-node](https://www.npmjs.com/package/@lowdefy/server-node).

## Running the server

### Step 1 - Create a `package.json` file

To run the server in a Lowdefy project, first, initialise a Node.js project by creating a `package.json` file in the root of your project. To do this, you can run

```
npm init
```

### Step 2 - Add the `@lowdefy/server-node` package to your project as a dependency

To add the server as a dependency, run

```
npm install @lowdefy/server-node --save
```

### Step 3 - Build the Lowdefy project

Build the Lowdefy configuration files in the project by running:

```
npx lowdefy build
```

> You can also install the Lowdefy CLI as a dev dependency using `npm install lowdefy --save-dev` and run the build command using `lowdefy build`.

### Step 4 - Start the server

To start the server, run:

```
npm run start
```

or

```
node dist/server.js
```

## Configuration

The Lowdefy server can be configured using command-line arguments or environment variables. The command-line arguments take precedence over the environment variables.

The following command-line arguments can be specified:

- `--build-directory`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
- `--port`: The port at which to run the server. The default is `3000`.
- `--public-directory`: The directory of the public assets to be served. The default is `./public`.

The following environment variables can be specified:

- `LOWDEFY_SERVER_BUILD_DIRECTORY`: The directory of the built Lowdefy configuration (The output of `lowdefy build`, usually found at `./.lowdefy/build` in your project repository). The default is `./.lowdefy/build`.
- `LOWDEFY_SERVER_PORT`: The port at which to run the server. The default is `3000`.
- `LOWDEFY_SERVER_PUBLIC_DIRECTORY`: The directory of the public assets to be served. The default is `./public`.

## More Lowdefy resources

- Getting started with Lowdefy - https://docs.lowdefy.com/tutorial-start
- Lowdefy docs - https://docs.lowdefy.com
- Lowdefy website - https://lowdefy.com
- Community forum - https://github.com/lowdefy/lowdefy/discussions
- Bug reports and feature requests - https://github.com/lowdefy/lowdefy/issues

## Licence

[Apache-2.0](https://github.com/lowdefy/lowdefy/blob/main/LICENSE)