chore: update Dockerfile

This commit is contained in:
chenos 2024-11-18 22:38:57 +08:00
parent 786cb5ac3c
commit 23e8a697b1
2 changed files with 5 additions and 11 deletions

View File

@ -46,6 +46,7 @@ RUN echo "${COMMIT_HASH}" > /tmp/commit_hash.txt
FROM node:20.13-bullseye-slim
RUN apt-get update && apt-get install -y nginx libaio1
RUN rm -rf /etc/nginx/sites-enabled/default
COPY ./docker/nocobase/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz
COPY --from=builder /tmp/commit_hash.txt /app/commit_hash.txt

View File

@ -40,26 +40,19 @@ RUN cd /app \
&& rm -rf nocobase.tar.gz \
&& tar -zcf ./nocobase.tar.gz -C /app/my-nocobase-app .
RUN echo "${COMMIT_HASH}" > /tmp/commit_hash.txt
FROM node:20.13-bullseye-slim
RUN apt-get update && apt-get install -y nginx libaio1
RUN rm -rf /etc/nginx/sites-enabled/default
COPY ./docker/nocobase/nocobase.conf /etc/nginx/sites-enabled/nocobase.conf
COPY --from=builder /app/nocobase.tar.gz /app/nocobase.tar.gz
COPY --from=builder /tmp/commit_hash.txt /app/commit_hash.txt
WORKDIR /app/nocobase
RUN mkdir -p /app/nocobase/storage/uploads/ && echo "$COMMIT_HASH" >> /app/nocobase/storage/uploads/COMMIT_HASH
# install postgresql-client and mysql-client
RUN apt update && apt install -y wget postgresql-common gnupg \
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y \
&& apt install -y postgresql-client-16 \
&& wget https://downloads.mysql.com/archives/get/p/23/file/mysql-community-client-core_8.1.0-1debian11_amd64.deb \
&& dpkg -x mysql-community-client-core_8.1.0-1debian11_amd64.deb /tmp/mysql-client \
&& cp /tmp/mysql-client/usr/bin/mysqldump /usr/bin/ \
&& cp /tmp/mysql-client/usr/bin/mysql /usr/bin/
COPY ./docker/nocobase/docker-entrypoint.sh /app/
CMD ["/app/docker-entrypoint.sh"]