The official Docker image for Lux.
Create a Dockerfile in the root of your Lux project directory.
FROM zacharygolba/lux-framework:latest-onbuild
You can then build and run the Docker image:
docker build -t my-lux-app .
docker run -it --rm --name my-running-app my-lux-app
The lux-framework
images mirror the format of the official Node.js Docker images. For more information on the different image formats, see the image variants section of the official Node.js docker repo.
This image will only install Node.js, Lux, and their dependencies. Use this image if you need to customize your environment before running your application.
FROM zacharygolba/lux-framework:latest
RUN mkdir -p /usr/src/my-lux-app
WORKDIR /usr/src/my-lux-app
COPY package.json /usr/src/my-lux-app
RUN npm install
COPY . /usr/src/my-lux-app
EXPOSE 4000
CMD ["lux", "serve"]
This image contains all of the logic to get a standard Lux project dockerized with little to no effort. If all you need to do in your Dockerfile is get your application up and running, you should use this image.
Since the ONBUILD
triggers can be unpredictable, it is recommended that you use the basic lux-framework:<version>
image if you need to run additional commands to get your application environment running.
FROM zacharygolba/lux-framework:latest-onbuild
This image is essentially the same as lux-framework:<version>
except it builds on the node:slim
image which only contains the bare bones to run a Lux application. You will most likely have to install additional packages from your Dockerfile if you use this image.
FROM zacharygolba/lux-framework:latest-slim
RUN mkdir -p /usr/src/my-lux-app
WORKDIR /usr/src/my-lux-app
COPY package.json /usr/src/my-lux-app
RUN npm install
COPY . /usr/src/my-lux-app
EXPOSE 4000
CMD ["lux", "serve"]