2021-09-29 09:03:27 +00:00
|
|
|
FROM ubuntu:20.04
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
LABEL maintainer="tech@appsmith.com"
|
|
|
|
|
|
|
|
|
|
# Set workdir to /opt/appsmith
|
|
|
|
|
WORKDIR /opt/appsmith
|
|
|
|
|
|
2021-09-28 05:04:33 +00:00
|
|
|
# The env variables are needed for Appsmith server to correctly handle non-roman scripts like Arabic.
|
2022-04-01 06:58:03 +00:00
|
|
|
ENV LANG C.UTF-8
|
|
|
|
|
ENV LC_ALL C.UTF-8
|
2021-09-28 05:04:33 +00:00
|
|
|
|
2021-09-29 09:03:27 +00:00
|
|
|
# Update APT packages - Base Layer
|
2022-03-31 11:05:11 +00:00
|
|
|
RUN apt-get update \
|
|
|
|
|
&& apt-get upgrade --yes \
|
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
|
|
|
|
supervisor curl cron certbot nginx gnupg wget netcat openssh-client \
|
|
|
|
|
software-properties-common gettext openjdk-11-jre \
|
2022-06-01 05:44:27 +00:00
|
|
|
python3-pip python-setuptools git ca-certificates-java \
|
2021-10-19 07:29:55 +00:00
|
|
|
&& pip install --no-cache-dir git+https://github.com/coderanger/supervisor-stdout@973ba19967cdaf46d9c1634d1675fc65b9574f6e \
|
2022-04-29 03:31:27 +00:00
|
|
|
&& apt-get remove -y git python3-pip
|
2021-09-01 05:32:08 +00:00
|
|
|
|
2021-09-29 09:03:27 +00:00
|
|
|
# Install MongoDB v4.0.5, Redis, NodeJS - Service Layer
|
2021-09-01 05:32:08 +00:00
|
|
|
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
|
2021-09-29 09:03:27 +00:00
|
|
|
RUN echo "deb [ arch=amd64,arm64 ]http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list \
|
|
|
|
|
&& apt-get remove wget -y
|
2021-09-01 05:32:08 +00:00
|
|
|
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
|
2022-04-29 03:31:27 +00:00
|
|
|
&& apt-get install --no-install-recommends -y mongodb-org=4.4.6 nodejs redis build-essential \
|
2021-09-29 09:03:27 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
# Clean up cache file - Service layer
|
|
|
|
|
RUN rm -rf \
|
2021-09-29 09:03:27 +00:00
|
|
|
/root/.cache \
|
|
|
|
|
/root/.npm \
|
|
|
|
|
/root/.pip \
|
|
|
|
|
/usr/local/share/doc \
|
|
|
|
|
/usr/share/doc \
|
|
|
|
|
/usr/share/man \
|
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
|
/tmp/*
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
# Define volumes - Service Layer
|
|
|
|
|
VOLUME [ "/appsmith-stacks" ]
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
|
# Add backend server - Application Layer
|
2021-09-23 14:28:53 +00:00
|
|
|
ARG JAR_FILE=./app/server/dist/server-*.jar
|
|
|
|
|
ARG PLUGIN_JARS=./app/server/dist/plugins/*.jar
|
2021-09-01 05:32:08 +00:00
|
|
|
ARG APPSMITH_SEGMENT_CE_KEY
|
|
|
|
|
ENV APPSMITH_SEGMENT_CE_KEY=${APPSMITH_SEGMENT_CE_KEY}
|
|
|
|
|
#Create the plugins directory
|
|
|
|
|
RUN mkdir -p ./backend ./editor ./rts ./backend/plugins ./templates ./utils
|
|
|
|
|
|
|
|
|
|
#Add the jar to the container
|
|
|
|
|
COPY ${JAR_FILE} backend/server.jar
|
|
|
|
|
COPY ${PLUGIN_JARS} backend/plugins/
|
|
|
|
|
|
|
|
|
|
# Add client UI - Application Layer
|
|
|
|
|
COPY ./app/client/build editor/
|
|
|
|
|
|
|
|
|
|
# Add RTS - Application Layer
|
2022-08-17 13:40:10 +00:00
|
|
|
COPY ./app/rts/package.json ./app/rts/dist rts/
|
2021-09-01 05:32:08 +00:00
|
|
|
COPY ./app/rts/node_modules rts/node_modules
|
|
|
|
|
|
|
|
|
|
# Nginx & MongoDB config template - Configuration layer
|
2022-01-31 07:57:01 +00:00
|
|
|
COPY ./deploy/docker/templates/nginx/* \
|
|
|
|
|
./deploy/docker/templates/mongo-init.js.sh\
|
|
|
|
|
./deploy/docker/templates/docker.env.sh \
|
|
|
|
|
templates/
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
# Add bootstrapfile
|
2021-09-14 13:31:06 +00:00
|
|
|
COPY ./deploy/docker/entrypoint.sh ./deploy/docker/scripts/* ./
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
# Add uitl tools
|
2021-09-14 13:31:06 +00:00
|
|
|
COPY ./deploy/docker/utils ./utils
|
2021-09-01 05:32:08 +00:00
|
|
|
RUN cd ./utils && npm install && npm install -g .
|
|
|
|
|
|
|
|
|
|
# Add process config to be run by supervisord
|
2021-09-14 13:31:06 +00:00
|
|
|
COPY ./deploy/docker/templates/supervisord.conf /etc/supervisor/supervisord.conf
|
|
|
|
|
COPY ./deploy/docker/templates/supervisord/ templates/supervisord/
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
# Add defined cron job
|
2021-09-14 13:31:06 +00:00
|
|
|
COPY ./deploy/docker/templates/cron.d /etc/cron.d/
|
2021-09-01 05:32:08 +00:00
|
|
|
RUN chmod 0644 /etc/cron.d/*
|
|
|
|
|
|
2022-05-06 06:15:56 +00:00
|
|
|
RUN chmod +x entrypoint.sh renew-certificate.sh healthcheck.sh
|
2021-09-01 05:32:08 +00:00
|
|
|
|
2022-04-27 07:27:57 +00:00
|
|
|
# Disable setuid/setgid bits for the files inside container.
|
2022-04-29 03:31:27 +00:00
|
|
|
RUN find / \( -path /proc -prune \) -o \( \( -perm -2000 -o -perm -4000 \) -print -exec chmod -s '{}' + \) || true
|
2022-04-27 07:27:57 +00:00
|
|
|
|
2021-09-01 05:32:08 +00:00
|
|
|
# Update path to load appsmith utils tool as default
|
|
|
|
|
ENV PATH /opt/appsmith/utils/node_modules/.bin:$PATH
|
2022-07-28 12:15:28 +00:00
|
|
|
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check=/watchtower-hooks/pre-check.sh
|
|
|
|
|
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update=/watchtower-hooks/pre-update.sh
|
|
|
|
|
COPY ./deploy/docker/watchtower-hooks /watchtower-hooks
|
|
|
|
|
RUN chmod +x /watchtower-hooks/pre-check.sh
|
|
|
|
|
RUN chmod +x /watchtower-hooks/pre-update.sh
|
|
|
|
|
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
EXPOSE 443
|
|
|
|
|
ENTRYPOINT [ "/opt/appsmith/entrypoint.sh" ]
|
2022-05-06 06:15:56 +00:00
|
|
|
HEALTHCHECK --interval=15s --timeout=15s --start-period=45s CMD "/opt/appsmith/healthcheck.sh"
|
2021-09-14 13:31:06 +00:00
|
|
|
CMD ["/usr/bin/supervisord", "-n"]
|