mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-21 05:44:51 +08:00
chore: build the full docker image (#6898)
* chore: build full docker image * fix: dockerfile-cn * chore: update Dockerfile * fix: error * chore: update ci
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
FROM node:20-bookworm-slim as builder
|
||||
|
||||
ARG CNA_VERSION=latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN cd /app \
|
||||
&& yarn config set network-timeout 600000 -g \
|
||||
&& npx -y create-nocobase-app@${CNA_VERSION} my-nocobase-app --skip-dev-dependencies -a -e APP_ENV=production \
|
||||
&& cd /app/my-nocobase-app \
|
||||
&& yarn install --production \
|
||||
&& rm -rf yarn.lock \
|
||||
&& find node_modules -type f -name "yarn.lock" -delete \
|
||||
&& find node_modules -type f -name "bower.json" -delete \
|
||||
&& find node_modules -type f -name "composer.json" -delete
|
||||
|
||||
RUN cd /app \
|
||||
&& rm -rf nocobase.tar.gz \
|
||||
&& tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app .
|
||||
|
||||
FROM node:20-bookworm-slim
|
||||
|
||||
RUN tee /etc/apt/sources.list > /dev/null <<EOF
|
||||
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
|
||||
deb-src http://mirrors.aliyun.com/debian/ bookworm main contrib non-free
|
||||
deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
|
||||
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free
|
||||
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
|
||||
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free
|
||||
deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
|
||||
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free
|
||||
EOF
|
||||
|
||||
RUN rm -rf /etc/apt/sources.list.d/debian.sources && apt-get update && apt-get install -y --no-install-recommends wget gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends wget gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN sh -c 'echo "deb http://mirrors.aliyun.com/postgresql/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
|
||||
RUN wget --quiet -O - http://mirrors.aliyun.com/postgresql/repos/apt/ACCC4CF8.asc | apt-key add -
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
nginx \
|
||||
libaio1 \
|
||||
postgresql-client-16 \
|
||||
postgresql-client-17 \
|
||||
libfreetype6 \
|
||||
fontconfig \
|
||||
libgssapi-krb5-2 \
|
||||
fonts-liberation \
|
||||
fonts-noto-cjk \
|
||||
unzip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN rm -rf /etc/nginx/sites-enabled/default
|
||||
COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz
|
||||
|
||||
RUN wget --no-check-certificate -O /opt/libreoffice24.8.zip https://static-docs.nocobase.com/libreoffice24.8.zip
|
||||
RUN wget --no-check-certificate -O /opt/instantclient_19_25.zip https://download.oracle.com/otn_software/linux/instantclient/1925000/instantclient-basic-linux.x64-19.25.0.0.0dbru.zip
|
||||
RUN wget --no-check-certificate https://downloads.mysql.com/archives/get/p/23/file/mysql-community-client-core_8.0.39-1debian12_amd64.deb && \
|
||||
dpkg -x mysql-community-client-core_8.0.39-1debian12_amd64.deb /tmp/mysql-client && \
|
||||
cp /tmp/mysql-client/usr/bin/mysqldump /usr/bin/ && \
|
||||
cp /tmp/mysql-client/usr/bin/mysql /usr/bin/ && \
|
||||
rm mysql-community-client-core_8.0.39-1debian12_amd64.deb
|
||||
|
||||
WORKDIR /app/nocobase
|
||||
|
||||
COPY docker-entrypoint.sh /app/
|
||||
# COPY docker-entrypoint.sh /usr/local/bin/
|
||||
# ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
EXPOSE 80/tcp
|
||||
|
||||
CMD ["/app/docker-entrypoint.sh"]
|
||||
@@ -5,6 +5,18 @@ echo "COMMIT_HASH: $(cat /app/commit_hash.txt)"
|
||||
|
||||
export NOCOBASE_RUNNING_IN_DOCKER=true
|
||||
|
||||
if [ -f /opt/libreoffice24.8.zip ] && [ ! -d /opt/libreoffice24.8 ]; then
|
||||
echo "Unzipping /opt/libreoffice24.8.zip..."
|
||||
unzip /opt/libreoffice24.8.zip -d /opt/
|
||||
fi
|
||||
|
||||
if [ -f /opt/instantclient_19_25.zip ] && [ ! -d /opt/instantclient_19_25 ]; then
|
||||
echo "Unzipping /opt/instantclient_19_25.zip..."
|
||||
unzip /opt/instantclient_19_25.zip -d /opt/
|
||||
echo "/opt/instantclient_19_25" > /etc/ld.so.conf.d/oracle-instantclient.conf
|
||||
ldconfig
|
||||
fi
|
||||
|
||||
if [ ! -d "/app/nocobase" ]; then
|
||||
mkdir nocobase
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user