3.23.3 • Published 2 years ago

@lowdefy/server-docker v3.23.3

Weekly downloads
129
License
Apache-2.0
Repository
github
Last release
2 years ago

@lowdefy/server-docker

The official Lowdefy Docker images can be found on Docker Hub.

Examples of Docker configuration can be found in the example repository.

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:

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

Licence

Apache-2.0

3.23.3

2 years ago

3.23.1

2 years ago

3.23.0

2 years ago

3.23.0-alpha.0

3 years ago

3.23.2

2 years ago

3.22.0

3 years ago

3.22.0-alpha.1

3 years ago

3.22.0-alpha.0

3 years ago

3.21.2-alpha.0

3 years ago

3.21.2

3 years ago

3.21.1

3 years ago

3.21.0

3 years ago

3.20.0

3 years ago

3.20.2

3 years ago

3.20.1

3 years ago

3.20.4

3 years ago

3.20.3

3 years ago

3.19.0

3 years ago

3.18.1

3 years ago

3.18.0

3 years ago

3.17.2

3 years ago

3.17.1

3 years ago

3.17.0

3 years ago

3.17.0-alpha.3

3 years ago

3.17.0-alpha.2

3 years ago

3.17.0-alpha.1

3 years ago

3.16.5

3 years ago

3.16.4

3 years ago

3.16.3

3 years ago

3.16.2

3 years ago

3.16.1

3 years ago

3.16.0

3 years ago

3.15.0

3 years ago

3.14.1

3 years ago

3.14.0

3 years ago

3.13.0

3 years ago

3.12.6

3 years ago

3.12.5

3 years ago

3.12.4

3 years ago

3.12.3

3 years ago

3.12.2

3 years ago

3.12.1

3 years ago

3.12.0

3 years ago

3.11.4

3 years ago

3.11.3

3 years ago

3.11.0

3 years ago

3.11.2

3 years ago

3.11.1

3 years ago

3.10.2

3 years ago

3.10.1

3 years ago

3.10.0

3 years ago

3.9.0

3 years ago

3.8.0

3 years ago

3.7.2

3 years ago

3.7.1

3 years ago

3.7.0

3 years ago

3.6.0

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.0

3 years ago

3.1.1

3 years ago

0.0.1

3 years ago

0.0.0-alpha.7

3 years ago