2022-06-16 20:30:34 +02:00
|
|
|
FROM couchdb:3.2.1
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-06-16 20:30:34 +02:00
|
|
|
ENV DEPLOYMENT_ENVIRONMENT=docker \
|
|
|
|
POSTHOG_TOKEN=phc_fg5I3nDOf6oJVMHSaycEhpPdlgS8rzXG2r6F2IpxCHS \
|
|
|
|
COUCHDB_PASSWORD=budibase \
|
|
|
|
COUCHDB_USER=budibase \
|
|
|
|
COUCH_DB_URL=http://budibase:budibase@localhost:5984 \
|
|
|
|
BUDIBASE_ENVIRONMENT=PRODUCTION \
|
|
|
|
MINIO_URL=http://localhost:9000 \
|
|
|
|
REDIS_URL=localhost:6379 \
|
|
|
|
WORKER_URL=http://localhost:4002 \
|
|
|
|
INTERNAL_API_KEY=budibase \
|
|
|
|
JWT_SECRET=testsecret \
|
|
|
|
MINIO_ACCESS_KEY=budibase \
|
|
|
|
MINIO_SECRET_KEY=budibase \
|
|
|
|
SELF_HOSTED=1 \
|
|
|
|
CLUSTER_PORT=10000 \
|
|
|
|
REDIS_PASSWORD=budibase \
|
|
|
|
ARCHITECTURE=amd \
|
|
|
|
APP_PORT=4001 \
|
|
|
|
WORKER_PORT=4002
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-06-16 20:30:34 +02:00
|
|
|
# install base dependencies
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install software-properties-common wget -y && \
|
|
|
|
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main' && \
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
# install other dependencies, nodejs, oracle requirements, jdk8, redis, nginx
|
|
|
|
WORKDIR /nodejs
|
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_16.x -o /tmp/nodesource_setup.sh && \
|
|
|
|
bash /tmp/nodesource_setup.sh && \
|
|
|
|
apt-get install libaio1 nodejs nginx openjdk-8-jdk redis-server unzip -y && \
|
|
|
|
npm install --global yarn pm2
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-04-05 12:33:55 +02:00
|
|
|
# setup nginx
|
|
|
|
ADD hosting/single/nginx.conf /etc/nginx
|
2022-06-16 20:30:34 +02:00
|
|
|
RUN mkdir /etc/nginx/logs && \
|
|
|
|
useradd www && \
|
|
|
|
touch /etc/nginx/logs/error.log && \
|
|
|
|
touch /etc/nginx/logs/nginx.pid
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-06-16 20:30:34 +02:00
|
|
|
# add pin script
|
|
|
|
WORKDIR /
|
|
|
|
ADD scripts/pinVersions.js .
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-06-16 20:30:34 +02:00
|
|
|
# setup server and install client for oracle datasource
|
2022-04-01 02:00:52 +02:00
|
|
|
WORKDIR /app
|
|
|
|
ADD packages/server .
|
2022-06-16 20:30:34 +02:00
|
|
|
RUN node /pinVersions.js && yarn && yarn build && \
|
|
|
|
/bin/bash -e scripts/integrations/oracle/instantclient/linux/x86-64/install.sh
|
2022-04-01 02:00:52 +02:00
|
|
|
|
|
|
|
# setup worker
|
|
|
|
WORKDIR /worker
|
|
|
|
ADD packages/worker .
|
2022-06-16 20:30:34 +02:00
|
|
|
RUN node /pinVersions.js && yarn && yarn build
|
2022-04-01 02:00:52 +02:00
|
|
|
|
|
|
|
# setup clouseau
|
|
|
|
WORKDIR /
|
2022-06-16 20:30:34 +02:00
|
|
|
RUN wget https://github.com/cloudant-labs/clouseau/releases/download/2.21.0/clouseau-2.21.0-dist.zip && \
|
|
|
|
unzip clouseau-2.21.0-dist.zip && \
|
|
|
|
mv clouseau-2.21.0 /opt/clouseau && \
|
|
|
|
rm clouseau-2.21.0-dist.zip
|
2022-04-01 02:00:52 +02:00
|
|
|
|
|
|
|
WORKDIR /opt/clouseau
|
|
|
|
RUN mkdir ./bin
|
|
|
|
ADD hosting/single/clouseau ./bin/
|
2022-06-16 20:30:34 +02:00
|
|
|
ADD hosting/single/log4j.properties hosting/single/clouseau.ini ./
|
2022-04-01 02:00:52 +02:00
|
|
|
RUN chmod +x ./bin/clouseau
|
|
|
|
|
|
|
|
# setup CouchDB
|
|
|
|
WORKDIR /opt/couchdb
|
|
|
|
ADD hosting/single/vm.args ./etc/
|
|
|
|
|
|
|
|
# setup minio
|
|
|
|
WORKDIR /minio
|
2022-06-16 20:30:34 +02:00
|
|
|
RUN wget https://dl.min.io/server/minio/release/linux-${ARCHITECTURE}64/minio && chmod +x minio
|
2022-04-01 02:00:52 +02:00
|
|
|
|
2022-04-05 12:33:55 +02:00
|
|
|
# setup runner file
|
2022-04-01 02:00:52 +02:00
|
|
|
WORKDIR /
|
|
|
|
ADD hosting/single/runner.sh .
|
|
|
|
RUN chmod +x ./runner.sh
|
|
|
|
|
|
|
|
EXPOSE 10000
|
2022-04-01 13:50:26 +02:00
|
|
|
VOLUME /opt/couchdb/data
|
|
|
|
VOLUME /minio
|
2022-04-01 02:00:52 +02:00
|
|
|
|
|
|
|
# must set this just before running
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
CMD ["./runner.sh"]
|