Fixes for prod build.

This commit is contained in:
Buster Neece 2023-08-05 11:37:40 -05:00
parent 2e09fbfde1
commit d583cbe295
No known key found for this signature in database
3 changed files with 3 additions and 49 deletions

View File

@ -143,6 +143,8 @@ jobs:
path: |
.gitinfo
translations
web/static/vite_dist
web/static/api/openapi.yml
build:
name: Build & Publish

View File

@ -147,20 +147,7 @@ RUN composer install \
COPY --chown=azuracast:azuracast . .
RUN composer dump-autoload --optimize --classmap-authoritative \
&& touch /var/azuracast/.docker
WORKDIR /var/azuracast/www/frontend
RUN npm ci --include=dev \
&& npm run build
WORKDIR /var/azuracast/www
RUN php bin/console locale:import \
&& php bin/console azuracast:api:docs \
&& rm -rf ./translations \
&& rm -rf ./frontend
RUN composer dump-autoload --optimize --classmap-authoritative
USER root

View File

@ -1,35 +0,0 @@
FROM library/node:lts-alpine
RUN apk update \
&& apk add bash python3 make curl g++ shadow git
RUN groupdel dialout
RUN mkdir -p /data/frontend/node_modules /data/translations /data/web/static \
&& chown -R node:node /data
RUN USER=node && \
GROUP=node && \
curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.5.1/fixuid-0.5.1-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
chown root:root /usr/local/bin/fixuid && \
chmod 4755 /usr/local/bin/fixuid && \
mkdir -p /etc/fixuid && \
printf "user: $USER\ngroup: $GROUP\npaths:\n - /\n - /data/frontend/node_modules\n" > /etc/fixuid/config.yml
COPY ./entrypoint.sh /
RUN chmod a+x /entrypoint.sh
# Define working directory.
WORKDIR /data/frontend
# Define working user.
USER node:node
VOLUME /data/frontend/node_modules
ENV NODE_ENV=production
ENV HOME=/home/node
# Define default command.
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]