diff --git a/admin.k8s.Dockerfile b/admin.k8s.Dockerfile new file mode 100644 index 000000000..dce4458a4 --- /dev/null +++ b/admin.k8s.Dockerfile @@ -0,0 +1,37 @@ +# Stage 1: Install dependencies and build the project +FROM node:16-bookworm-slim AS builder +WORKDIR /app + +# Copy package.json and package-lock.json (or npm-shrinkwrap.json) +COPY ./admin_view/nuxt-project/package*.json ./ + +# Install dependencies +RUN npm ci + +# Copy Nuxt.js application source code +COPY ./admin_view/nuxt-project/ ./ + +# Build the application +RUN npm run build + +# Stage 2: Serve the app using a Node.js server +FROM node:16-bookworm-slim AS runner +WORKDIR /app + +# Copy the built server and client code +COPY --from=builder /app/nuxt.config.js ./nuxt.config.js +COPY --from=builder --chown=nonroot:nonroot /app/.nuxt ./.nuxt +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/package-lock.json ./package-lock.json +COPY --from=builder /app/store ./store +COPY --from=builder /app/static ./static +COPY --from=builder /app/assets ./assets +# Set environment variables +ENV NODE_ENV production + +# Expose the port the app runs on +EXPOSE 8000 + +# Start the application +CMD ["node_modules/.bin/nuxt", "start"] diff --git a/api.k8s.Dockerfile b/api.k8s.Dockerfile new file mode 100644 index 000000000..54068c179 --- /dev/null +++ b/api.k8s.Dockerfile @@ -0,0 +1,8 @@ +FROM ruby:2.7.1 +WORKDIR /myapp +ENV RAILS_ENV="production" +ENV RAILS_LOG_TO_STDOUT=ON +COPY ./api /myapp +RUN bundle install +CMD ["rails", "server", "-b", "0.0.0.0", "-p", "3000"] +EXPOSE 3000 \ No newline at end of file