mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
Running alembic migrations whenever api container is started.
This commit is contained in:
parent
78a83dc63e
commit
833f58dbfb
9 changed files with 131 additions and 28 deletions
|
|
@ -1,26 +1,20 @@
|
|||
# Build stage
|
||||
FROM node:18-alpine AS builder
|
||||
FROM node:18-alpine
|
||||
WORKDIR /app
|
||||
ENV PATH=/app/node_modules/.bin:$PATH
|
||||
|
||||
# Install serve and production dependencies
|
||||
RUN npm install -g serve && \
|
||||
npm cache clean --force
|
||||
|
||||
# Copy package files and install production dependencies
|
||||
COPY app/package.json app/package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
RUN npm ci --omit=dev && \
|
||||
npm cache clean --force
|
||||
|
||||
# Copy source files and build
|
||||
COPY app/public ./public
|
||||
COPY app/src ./src
|
||||
RUN npm run build
|
||||
|
||||
# Runtime stage
|
||||
FROM nginx:alpine
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
# Copy static build from builder stage
|
||||
COPY --from=builder /app/build ./
|
||||
|
||||
# Expose port
|
||||
EXPOSE 80
|
||||
|
||||
# Run Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
# Serve the production build
|
||||
CMD ["serve", "-s", "build", "-l", "3000"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue