Fixes for prod build.
This commit is contained in:
parent
2e09fbfde1
commit
d583cbe295
|
@ -143,6 +143,8 @@ jobs:
|
|||
path: |
|
||||
.gitinfo
|
||||
translations
|
||||
web/static/vite_dist
|
||||
web/static/api/openapi.yml
|
||||
|
||||
build:
|
||||
name: Build & Publish
|
||||
|
|
15
Dockerfile
15
Dockerfile
|
@ -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
|
||||
|
||||
|
|
|
@ -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"]
|
Loading…
Reference in New Issue