-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
955c983
commit 8b4488b
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |