phobos/Dockerfile
2024-07-23 00:38:58 +02:00

26 lines
No EOL
582 B
Docker

FROM node:lts-slim as runtime
WORKDIR /app
# Ensure that both node_modules and package-lock.json are removed.
COPY package.json .
RUN rm -rf node_modules
# Perform a fresh installation of npm dependencies.
RUN npm install
# Copy the rest of your application files.
COPY . .
# Build your application.
RUN npm run build
ARG POCKETBASE_URL
ARG PORT=4321
# Set environment variables and expose the appropriate port.
ENV HOST=0.0.0.0
ENV PORT=${PORT}
ENV POCKETBASE_URL=${POCKETBASE_URL}
EXPOSE ${PORT}
# Define the command to run your application.
CMD node ./dist/server/entry.mjs