2023-12-13 10:28:25 +08:00
|
|
|
FROM node:18-bullseye-slim as builder
|
2022-07-08 11:02:33 +08:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN cd /app \
|
2022-10-24 16:56:27 +08:00
|
|
|
&& yarn config set network-timeout 600000 -g \
|
2022-07-08 11:02:33 +08:00
|
|
|
&& yarn create nocobase-app my-nocobase-app -a -e APP_ENV=production \
|
|
|
|
&& cd /app/my-nocobase-app \
|
|
|
|
&& yarn install --production
|
|
|
|
|
|
|
|
RUN cd /app \
|
|
|
|
&& rm -rf nocobase.tar.gz \
|
2022-07-28 21:06:21 +08:00
|
|
|
&& tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app .
|
2022-07-08 11:02:33 +08:00
|
|
|
|
2023-12-13 10:28:25 +08:00
|
|
|
FROM node:18-bullseye-slim
|
2022-07-08 11:02:33 +08:00
|
|
|
|
|
|
|
# COPY ./sources.list /etc/apt/sources.list
|
|
|
|
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
|
|
|
|
&& case "${dpkgArch##*-}" in \
|
|
|
|
amd64) ARCH='x64';; \
|
|
|
|
ppc64el) ARCH='ppc64le';; \
|
|
|
|
s390x) ARCH='s390x';; \
|
|
|
|
arm64) ARCH='arm64';; \
|
|
|
|
armhf) ARCH='armv7l';; \
|
|
|
|
i386) ARCH='x86';; \
|
|
|
|
*) echo "unsupported architecture"; exit 1 ;; \
|
|
|
|
esac \
|
|
|
|
&& set -ex \
|
|
|
|
# libatomic1 for arm
|
|
|
|
&& apt-get update && apt-get install -y nginx
|
|
|
|
|
|
|
|
RUN rm -rf /etc/nginx/sites-enabled/default
|
|
|
|
COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz
|
|
|
|
|
|
|
|
WORKDIR /app/nocobase
|
|
|
|
|
|
|
|
COPY docker-entrypoint.sh /app/
|
|
|
|
# COPY docker-entrypoint.sh /usr/local/bin/
|
|
|
|
# ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
|
2024-02-20 10:42:32 +08:00
|
|
|
EXPOSE 80/tcp
|
|
|
|
|
2022-07-08 11:02:33 +08:00
|
|
|
CMD ["/app/docker-entrypoint.sh"]
|