Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
FROM alekzonder/puppeteer:1.3.0 as client-builder
MAINTAINER Arturo Volpe <arturovolpe@gmail.com>
RUN whoami
ENV BUILD_FOLDER /home/pptruser/client
RUN mkdir "$BUILD_FOLDER"
FROM node:20-bookworm AS client-builder
LABEL maintainer="Arturo Volpe <arturovolpe@gmail.com>"

# Install Chromium and dependencies for Puppeteer
RUN apt-get update && apt-get install -y \
chromium \
chromium-sandbox \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*

# Set environment variable to use system Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium

ENV BUILD_FOLDER=/home/node/client
RUN mkdir -p "$BUILD_FOLDER" && chown node:node "$BUILD_FOLDER"
WORKDIR $BUILD_FOLDER

COPY client/package.json "$BUILD_FOLDER"
COPY client/package-lock.json "$BUILD_FOLDER"
# Switch to node user
USER node

COPY --chown=node:node client/package.json client/package-lock.json "$BUILD_FOLDER"

RUN npm ci

COPY --chown=node:node client/. "$BUILD_FOLDER"

RUN npm install
COPY --chown=pptruser:pptruser client/. "$BUILD_FOLDER"
RUN npm run build

FROM openjdk:17.0.1-jdk as builder
FROM eclipse-temurin:17-jdk-jammy AS builder
ARG BRANCH_NAME
WORKDIR /app
COPY mvnw /app
Expand All @@ -21,14 +36,14 @@ COPY pom.xml /app
COPY src /app/src
COPY utils /app/utils

COPY --from=client-builder /home/pptruser/client/dist /app/src/main/resources/public
COPY --from=client-builder /home/node/client/dist /app/src/main/resources/public
RUN sh mvnw clean
RUN sh ./utils/gen_licenses.sh
RUN sh mvnw -B -q package
RUN sh mvnw -B -q clean install -Ppostgres -DskipTests


FROM openjdk:17.0.1
FROM eclipse-temurin:17-jre-jammy
VOLUME /tmp
COPY --from=builder /app/target/cotizaciones-2.1.0.jar app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
Expand Down
3 changes: 1 addition & 2 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
VUE_APP_API=http://localhost:8080/api
VUE_APP_API=https://cotizaciones.volpe.com.py/api
VUE_APP_SWAGGER=http://localhost:8080/swagger-ui.html
VUE_APP_SWAGGER=https://cotizaciones.volpe.com.py/swagger-ui/index.html
PORT=8081
Loading