FROM node:18-alpine  AS dependencies

# Install build tools for node-gyp and libxml2-utils for xmllint
RUN apk add --update make g++ linux-headers python3 libxml2-utils
WORKDIR /workspace
COPY package*.json ./
RUN npm install --legacy-peer-deps

FROM node:18-alpine
WORKDIR /workspace
# Copy the pre-installed dependencies from the 'dependencies' stage
# COPY --from=dependencies /app/node_modules ./node_modules
# Copy the rest of your application source code
# COPY . .
# Define the command to run your application
# CMD ["node", "src/index.js"]
# Copy the bundled mothership file
COPY ./dist/prebuild/mothership.mjs mothership.mjsasd
EXPOSE 8080
# CMD ['ls']
CMD ["node", "./dist/prebuild/mothership.mjs"]
