diff --git a/Dockerfile.local b/Dockerfile.local new file mode 100644 index 000000000..08d0452f3 --- /dev/null +++ b/Dockerfile.local @@ -0,0 +1,50 @@ +FROM node:20-bullseye-slim +ENV TZ Europe/Madrid + +ARG DEBIAN_FRONTEND=noninteractive + + +# Puppeteer + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + gnupg2 \ + graphicsmagick \ + libfontconfig lftp xvfb gconf-service libasound2 libatk1.0-0 libc6 \ + libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 \ + libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 \ + libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 \ + libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 \ + libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \ + fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget + +# Extra dependencies + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + samba-common-bin samba-dsdb-modules\ + && rm -rf /var/lib/apt/lists/* \ + && npm -g install pm2 + +# Salix + +WORKDIR /salix + +COPY print/package.json print/package-lock.json print/ +RUN npm --prefix ./print install ./print + +COPY package.json package-lock.json ./ +COPY loopback/package.json loopback/ +RUN npm install + +COPY gulpfile.js ./ + +COPY \ + LICENSE \ + README.md \ + ./ + +CMD ["npx", "gulp", "backOnly"] + +HEALTHCHECK --interval=15s --timeout=10s \ + CMD curl -f http://localhost:3000/api/Applications/status || exit 1 diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 72e0ad504..c2717738f 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -7,6 +7,7 @@ services: dockerfile: Dockerfile front: image: front + restart: unless-stopped build: context: . dockerfile: front/Dockerfile.local @@ -14,17 +15,43 @@ services: - 5000:5000 depends_on: - back + volumes: + - ./modules:/salix/modules + - ./dist:/salix/dist + - ./front:/salix/front + - ./loopback:/salix/loopback + x-develop: + watch: + - action: sync + - path: ./modules + - target: /modules back: image: salix-back + restart: unless-stopped build: context: . - dockerfile: Dockerfile + dockerfile: Dockerfile.local ports: - 3000:3000 environment: - NODE_ENV depends_on: - db + volumes: + - ./loopback:/salix/loopback + - ./storage:/salix/storage + - ./modules:/salix/modules + - ./back:/salix/back + - ./print:/salix/print + x-develop: + watch: + - action: sync + - path: ./back + - target: /back + - action: sync + - path: ./models + - target: /models networks: salix-stack-network: driver: host + diff --git a/front/Dockerfile.local b/front/Dockerfile.local index d54d53436..f31ee04fa 100644 --- a/front/Dockerfile.local +++ b/front/Dockerfile.local @@ -1,33 +1,13 @@ FROM salix-back EXPOSE 5000 -# ENV TZ Europe/Madrid - -# WORKDIR /front - -# COPY /front/gulpfile.js ./ -# COPY /front/webpack.config.js ./ -# COPY modules modules - -# RUN npm install \ -# require-yaml \ -# del@2.2.2 \ -# plugin-error \ -# minimist \ -# gulp@4.0.2 gulp-wrap gulp-concat gulp-merge-json gulp-file gulp-yaml\ -# webpack@5.83.1 webpack-merge@4.2.2 webpack-dev-server@3.11.0 html-webpack-plugin@5.5.1 \ -# fancy-log \ -# merge-stream@1.0.1 \ -# fs-extra -WORKDIR /salix - COPY /dist dist COPY /front front COPY /front/gulpfile.js ./ COPY /front/webpack.config.js ./ RUN cd front && npm install -RUN npx gulp build +# RUN npx gulp build # RUN npx gulp front CMD ["npx", "gulp", "front"] diff --git a/gulpfile.js b/gulpfile.js index d7e7d8e86..aa3aa7041 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,7 +3,6 @@ const gulp = require('gulp'); const PluginError = require('plugin-error'); const argv = require('minimist')(process.argv.slice(2)); const log = require('fancy-log'); -const Docker = require('./db/docker.js'); // Configuration