Make frontend container UID/GID aware.
This commit is contained in:
parent
7d29d78ff7
commit
8d0dc45461
10
docker.sh
10
docker.sh
|
@ -686,9 +686,13 @@ restore-legacy() {
|
|||
# Usage: ./docker.sh static [static_container_command]
|
||||
#
|
||||
static() {
|
||||
cd frontend || exit
|
||||
docker-compose build
|
||||
docker-compose run --rm frontend "$@"
|
||||
local PUID PGID
|
||||
PUID=$(id -u)
|
||||
PGID=$(id -g)
|
||||
|
||||
docker-compose -f frontend/docker-compose.yml down -v
|
||||
docker-compose -f frontend/docker-compose.yml build
|
||||
PUID=$PUID PGID=$PGID docker-compose -f frontend/docker-compose.yml run --rm frontend "$@"
|
||||
exit
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,19 @@
|
|||
FROM library/node:lts-alpine
|
||||
|
||||
RUN apk update \
|
||||
&& apk add bash python make g++
|
||||
&& apk add bash python make curl g++
|
||||
|
||||
RUN mkdir -p /data/frontend/node_modules /data/resources/locale /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\n" > /etc/fixuid/config.yml
|
||||
|
||||
COPY build_entrypoint.sh /
|
||||
RUN chmod a+x /build_entrypoint.sh
|
||||
|
||||
|
@ -13,10 +21,10 @@ RUN chmod a+x /build_entrypoint.sh
|
|||
WORKDIR /data/frontend
|
||||
|
||||
# Define working user.
|
||||
USER node
|
||||
USER node:node
|
||||
|
||||
VOLUME /data/frontend/node_modules
|
||||
|
||||
# Define default command.
|
||||
ENTRYPOINT ["/build_entrypoint.sh"]
|
||||
CMD ["npm", "run", "build"]
|
||||
ENTRYPOINT ["fixuid"]
|
||||
CMD ["npm", "run", "dev"]
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
npm ci
|
||||
|
||||
exec "$@"
|
|
@ -1,14 +1,14 @@
|
|||
version: '2.2'
|
||||
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: .
|
||||
volumes:
|
||||
services :
|
||||
frontend :
|
||||
container_name : azuracast_frontend
|
||||
build :
|
||||
context : .
|
||||
user : "${PUID:-1000}:${PGID:-1000}"
|
||||
volumes :
|
||||
- .:/data/frontend
|
||||
- ../resources/locale:/data/resources/locale
|
||||
- ../web/static:/data/web/static
|
||||
- frontend_node_modules:/data/frontend/node_modules
|
||||
|
||||
volumes:
|
||||
frontend_node_modules: {}
|
||||
volumes :
|
||||
frontend_node_modules : { }
|
||||
|
|
|
@ -1,76 +1,77 @@
|
|||
{
|
||||
"name": "azuracast",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"build": "gulp",
|
||||
"generate-locales": "gettext-extract --attribute v-translate --keywords '$gettext' --output ../resources/locale/frontend.pot $(find ./vue -type f -name '*.vue')",
|
||||
"import-locales": "gettext-compile --output ../resources/locale/translations.json $(find ../resources/locale/*.UTF-8 -type f -name 'frontend.po')",
|
||||
"ci": "npm run import-locales && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/preset-env": "^7.13.15",
|
||||
"@fancyapps/fancybox": "^3.5.7",
|
||||
"@flowjs/flow.js": "^2.14.1",
|
||||
"@fullcalendar/core": "^4",
|
||||
"@fullcalendar/daygrid": "^4",
|
||||
"@fullcalendar/moment": "^4",
|
||||
"@fullcalendar/moment-timezone": "^4",
|
||||
"@fullcalendar/timegrid": "^4",
|
||||
"@fullcalendar/vue": "^4",
|
||||
"autosize": "^4.0.2",
|
||||
"axios": "^0.21.1",
|
||||
"bootstrap": "^4.6.0",
|
||||
"bootstrap-daterangepicker": "^3.1.0",
|
||||
"bootstrap-notify": "^3.1.3",
|
||||
"bootstrap-vue": "^2.21.2",
|
||||
"chart.js": "^2.9.3",
|
||||
"chartjs-plugin-colorschemes": "^0.3.0",
|
||||
"chartjs-plugin-zoom": "^0.7.7",
|
||||
"clipboard": "^2.0.8",
|
||||
"codemirror": "^5.61.0",
|
||||
"css-loader": "^1.0",
|
||||
"del": "^3.0.0",
|
||||
"dirrty": "^1.0.0",
|
||||
"easygettext": "^2.17.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-babel": "^8.0.0",
|
||||
"gulp-clean-css": "^3.9.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-dart-sass": "^1.0.2",
|
||||
"gulp-ignore": "^3.0.0",
|
||||
"gulp-mode": "^1.1.0",
|
||||
"gulp-rev": "^8.1.1",
|
||||
"gulp-rev-delete-original": "^0.2.3",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"jquery": "^3.6.0",
|
||||
"leaflet": "^1.7.1",
|
||||
"leaflet.fullscreen": "^1.6.0",
|
||||
"lodash": "^4.17.21",
|
||||
"material-icons": "^0.5.5",
|
||||
"moment": "^2.29.1",
|
||||
"moment-timezone": "^0.5.33",
|
||||
"nchan": "^1.0.10",
|
||||
"popper.js": "^1.16.1",
|
||||
"prettier": "1.12.1",
|
||||
"roboto-fontface": "^0.10.0",
|
||||
"sass": "^1.32.12",
|
||||
"sass-loader": "^7.3.1",
|
||||
"select2": "^4.0.13",
|
||||
"sortablejs": "^1.13.0",
|
||||
"store": "^1.3.20",
|
||||
"sweetalert2": "^10.16.6",
|
||||
"vue": "^2.6.12",
|
||||
"vue-gettext": "^2.1.12",
|
||||
"vue-loader": "14.2.2",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuedraggable": "^2.24.1",
|
||||
"vuelidate": "^0.7.5",
|
||||
"wavesurfer.js": "^3.3.3",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-assets-manifest": "^3.1.1",
|
||||
"webpack-stream": "^5.1.1",
|
||||
"zxcvbn": "^4.4.2"
|
||||
}
|
||||
"name": "azuracast",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
"dev": "npm ci && bash",
|
||||
"build": "gulp",
|
||||
"generate-locales": "gettext-extract --attribute v-translate --keywords '$gettext' --output ../resources/locale/frontend.pot $(find ./vue -type f -name '*.vue')",
|
||||
"import-locales": "gettext-compile --output ../resources/locale/translations.json $(find ../resources/locale/*.UTF-8 -type f -name 'frontend.po')",
|
||||
"ci": "npm run import-locales && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.13.16",
|
||||
"@babel/preset-env": "^7.13.15",
|
||||
"@fancyapps/fancybox": "^3.5.7",
|
||||
"@flowjs/flow.js": "^2.14.1",
|
||||
"@fullcalendar/core": "^4",
|
||||
"@fullcalendar/daygrid": "^4",
|
||||
"@fullcalendar/moment": "^4",
|
||||
"@fullcalendar/moment-timezone": "^4",
|
||||
"@fullcalendar/timegrid": "^4",
|
||||
"@fullcalendar/vue": "^4",
|
||||
"autosize": "^4.0.2",
|
||||
"axios": "^0.21.1",
|
||||
"bootstrap": "^4.6.0",
|
||||
"bootstrap-daterangepicker": "^3.1.0",
|
||||
"bootstrap-notify": "^3.1.3",
|
||||
"bootstrap-vue": "^2.21.2",
|
||||
"chart.js": "^2.9.3",
|
||||
"chartjs-plugin-colorschemes": "^0.3.0",
|
||||
"chartjs-plugin-zoom": "^0.7.7",
|
||||
"clipboard": "^2.0.8",
|
||||
"codemirror": "^5.61.0",
|
||||
"css-loader": "^1.0",
|
||||
"del": "^3.0.0",
|
||||
"dirrty": "^1.0.0",
|
||||
"easygettext": "^2.17.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-babel": "^8.0.0",
|
||||
"gulp-clean-css": "^3.9.2",
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-dart-sass": "^1.0.2",
|
||||
"gulp-ignore": "^3.0.0",
|
||||
"gulp-mode": "^1.1.0",
|
||||
"gulp-rev": "^8.1.1",
|
||||
"gulp-rev-delete-original": "^0.2.3",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"gulp-uglify": "^3.0.2",
|
||||
"jquery": "^3.6.0",
|
||||
"leaflet": "^1.7.1",
|
||||
"leaflet.fullscreen": "^1.6.0",
|
||||
"lodash": "^4.17.21",
|
||||
"material-icons": "^0.5.5",
|
||||
"moment": "^2.29.1",
|
||||
"moment-timezone": "^0.5.33",
|
||||
"nchan": "^1.0.10",
|
||||
"popper.js": "^1.16.1",
|
||||
"prettier": "1.12.1",
|
||||
"roboto-fontface": "^0.10.0",
|
||||
"sass": "^1.32.12",
|
||||
"sass-loader": "^7.3.1",
|
||||
"select2": "^4.0.13",
|
||||
"sortablejs": "^1.13.0",
|
||||
"store": "^1.3.20",
|
||||
"sweetalert2": "^10.16.6",
|
||||
"vue": "^2.6.12",
|
||||
"vue-gettext": "^2.1.12",
|
||||
"vue-loader": "14.2.2",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuedraggable": "^2.24.1",
|
||||
"vuelidate": "^0.7.5",
|
||||
"wavesurfer.js": "^3.3.3",
|
||||
"webpack": "^4.46.0",
|
||||
"webpack-assets-manifest": "^3.1.1",
|
||||
"webpack-stream": "^5.1.1",
|
||||
"zxcvbn": "^4.4.2"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue