mirror of
https://github.com/appy-one/acebase-server.git
synced 2026-05-25 14:12:16 -06:00
- doesn't override shell's PATH to be "." (which was breaking all commands) - points to the correct location of the start.js file (src/start.js) - corrects the suggested "To run" comment to have acebase instead of acebace (with a second 'c') This dramatically improves the dockerfile's functionality, however it doesn't get the setup to a fully running state for me due to a TypeError at: /app/node_modules/acebase/src/storage.js:99 TypeError: Cannot read property 'on' of undefined (will continue chipping away at it)
26 lines
941 B
Docker
26 lines
941 B
Docker
# experimenting running in docker container.
|
|
# WARNING: running 1 instance is currently supported per db, running multiple will corrupt your data!
|
|
# To build a docker image, execute:
|
|
# docker build -t acebase-server .
|
|
# To run:
|
|
# docker volume create acebase-server-data
|
|
# docker run --name MyAceBaseServer1 -p 3000:3000 -p 4000:4000 -v acebase-server-data:/default.acebase acebase-server
|
|
|
|
FROM node:10-alpine
|
|
WORKDIR /app
|
|
COPY package.json .
|
|
RUN npm install
|
|
COPY src ./src
|
|
|
|
# Initialize build arguments passed to docker build --build-arg DBNAME=data ...
|
|
ARG DBNAME="data"
|
|
ARG PORT=3000
|
|
ARG CLUSTER_PORT=4000
|
|
ARG HOST="0.0.0.0"
|
|
ARG DBPATH="."
|
|
|
|
# Set defaults for runtime environment variables, can be overriden by: docker run --env DBNAME=mydb ...
|
|
ENV DBNAME=${DBNAME} HOST=${HOST} PORT=${PORT} CLUSTER_PORT=${CLUSTER_PORT} DBPATH=${DBPATH}
|
|
|
|
# Start server without arguments, environment variables will be used
|
|
CMD ["node", "src/start.js"]
|