Allow frontend container to run as non-root user
Also clean it up a bit
This commit is contained in:
parent
9540c791f6
commit
fb8eb8e2ed
|
@ -97,12 +97,6 @@ services:
|
||||||
ports:
|
ports:
|
||||||
# override those variables in your .env file if needed
|
# override those variables in your .env file if needed
|
||||||
- "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80"
|
- "${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT}:80"
|
||||||
command: >
|
|
||||||
sh -c "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\"
|
|
||||||
< /etc/nginx/conf.d/funkwhale.template
|
|
||||||
> /etc/nginx/conf.d/default.conf
|
|
||||||
&& cat /etc/nginx/conf.d/default.conf
|
|
||||||
&& nginx -g 'daemon off;'"
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
FROM node:16 as builder
|
FROM node:16 as builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json yarn.lock /app/
|
COPY package.json yarn.lock /app/
|
||||||
COPY src /app/src/
|
COPY src /app/src/
|
||||||
|
@ -9,7 +10,23 @@ COPY vite.config.js index.html embed.html /app/
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
RUN yarn build:deployment
|
RUN yarn build:deployment
|
||||||
|
|
||||||
|
|
||||||
FROM nginx:1.23.0-alpine as final
|
FROM nginx:1.23.0-alpine as final
|
||||||
|
|
||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||||
COPY docker/funkwhale.template /etc/nginx/conf.d/funkwhale.template
|
COPY docker/funkwhale.template /etc/nginx/conf.d/funkwhale.template
|
||||||
COPY docker/funkwhale_proxy.conf /etc/nginx/funkwhale_proxy.conf
|
COPY docker/funkwhale_proxy.conf /etc/nginx/funkwhale_proxy.conf
|
||||||
|
|
||||||
|
# Allow running as non-root for custom setups
|
||||||
|
RUN mkdir -p /var/log/nginx /var/cache/nginx /var/run/nginx && \
|
||||||
|
chown -R nginx:nginx /var/log/nginx /var/run/nginx /var/cache/nginx /etc/nginx && \
|
||||||
|
sed -e 's#/var/run/nginx.pid#/var/run/nginx/nginx.pid#' -i /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
CMD ["sh", "-c", "envsubst \"`env | awk -F = '{printf \" $$%s\", $$1}'`\" \
|
||||||
|
< /etc/nginx/conf.d/funkwhale.template \
|
||||||
|
> /etc/nginx/conf.d/default.conf \
|
||||||
|
&& cat /etc/nginx/conf.d/default.conf \
|
||||||
|
&& nginx -g 'daemon off;'"]
|
||||||
|
|
||||||
|
ENV FUNKWHALE_API_HOST=api
|
||||||
|
ENV FUNKWHALE_API_PORT=5000
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
upstream funkwhale-api {
|
upstream funkwhale-api {
|
||||||
# depending on your setup, you may want to update this
|
server ${FUNKWHALE_API_HOST}:${FUNKWHALE_API_PORT};
|
||||||
server api:5000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue