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 \
|
2022-12-19 09:30:24 +00:00
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
|
2023-08-31 06:29:28 +00:00
|
|
|
supervisor curl cron nfs-common nginx nginx-extras gnupg wget netcat openssh-client \
|
2023-09-06 08:20:23 +00:00
|
|
|
gettext \
|
|
|
|
|
python3-pip python3-venv git ca-certificates-java \
|
2023-01-02 12:40:59 +00:00
|
|
|
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add - \
|
|
|
|
|
&& echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \
|
|
|
|
|
&& apt-get update && apt-get install --no-install-recommends --yes temurin-17-jdk \
|
2021-10-19 07:29:55 +00:00
|
|
|
&& pip install --no-cache-dir git+https://github.com/coderanger/supervisor-stdout@973ba19967cdaf46d9c1634d1675fc65b9574f6e \
|
2023-08-31 06:29:28 +00:00
|
|
|
&& python3 -m venv --prompt certbot /opt/certbot/venv \
|
2023-09-14 04:56:01 +00:00
|
|
|
&& /opt/certbot/venv/bin/pip install --upgrade certbot setuptools pip \
|
2023-08-31 06:29:28 +00:00
|
|
|
&& ln -s /opt/certbot/venv/bin/certbot /usr/local/bin \
|
2023-09-06 08:20:23 +00:00
|
|
|
&& apt-get remove --yes git python3-pip python3-venv \
|
2023-09-04 10:27:04 +00:00
|
|
|
&& apt-get autoremove --yes
|
2022-12-19 09:30:24 +00:00
|
|
|
|
2023-03-07 09:52:41 +00:00
|
|
|
# Install MongoDB v5.0.14, Redis, NodeJS - Service Layer, PostgreSQL v13
|
2023-09-18 13:03:48 +00:00
|
|
|
RUN curl --silent --show-error --location https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add - \
|
|
|
|
|
&& echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list \
|
2023-08-08 00:23:17 +00:00
|
|
|
&& curl --silent --show-error --location https://deb.nodesource.com/setup_18.x | bash - \
|
2023-03-07 09:52:41 +00:00
|
|
|
&& echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list \
|
2023-07-31 11:25:46 +00:00
|
|
|
&& curl --silent --show-error --location https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
2023-03-07 09:52:41 +00:00
|
|
|
&& apt update \
|
2023-08-08 15:29:10 +00:00
|
|
|
&& apt-get install --no-install-recommends --yes mongodb-org nodejs redis build-essential postgresql-13 \
|
2023-09-14 04:56:01 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
|
# This is to get semver 7.5.2, for a CVE fix, might be able to remove it with later versions on NodeJS.
|
|
|
|
|
&& npm install -g npm@9.7.2
|
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" ]
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
2023-09-11 07:24:50 +00:00
|
|
|
ENV TMP /tmp/appsmith
|
|
|
|
|
|
2021-09-01 05:32:08 +00:00
|
|
|
# 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
|
2023-07-31 04:47:46 +00:00
|
|
|
|
|
|
|
|
ARG APPSMITH_CLOUD_SERVICES_BASE_URL
|
2023-07-31 11:25:46 +00:00
|
|
|
ENV APPSMITH_CLOUD_SERVICES_BASE_URL=${APPSMITH_CLOUD_SERVICES_BASE_URL}
|
2023-07-31 04:47:46 +00:00
|
|
|
|
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
|
2023-09-11 03:13:09 +00:00
|
|
|
RUN mkdir -p ./editor ./rts ./backend/plugins
|
|
|
|
|
|
|
|
|
|
COPY deploy/docker/fs /
|
2021-09-01 05:32:08 +00:00
|
|
|
|
|
|
|
|
#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
|
2023-05-22 12:55:46 +00:00
|
|
|
COPY ./app/client/packages/rts/package.json ./app/client/packages/rts/dist rts/
|
2021-09-01 05:32:08 +00:00
|
|
|
|
2023-09-11 03:13:09 +00:00
|
|
|
RUN cd ./utils && npm install --only=prod && npm install --only=prod -g . && cd - \
|
|
|
|
|
&& chmod 0644 /etc/cron.d/* \
|
|
|
|
|
&& chmod +x entrypoint.sh renew-certificate.sh healthcheck.sh /watchtower-hooks/*.sh \
|
|
|
|
|
# Disable setuid/setgid bits for the files inside container.
|
|
|
|
|
&& 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
|
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"]
|