This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
node_modules
|
||||||
|
.nuxt
|
||||||
|
.git
|
||||||
|
.github
|
||||||
|
*.md
|
||||||
|
arakrail.archive
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
ecosystem.config.js
|
||||||
+26
-30
@@ -4,50 +4,46 @@ RUN ALPINE_VERSION=$(cat /etc/alpine-release | cut -d'.' -f1-2) && \
|
|||||||
echo "https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
|
echo "https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
|
||||||
echo "https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
|
echo "https://linux-mirror.liara.ir/repository/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories
|
||||||
|
|
||||||
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/ \
|
||||||
|
NUXT_TELEMETRY_DISABLED=1
|
||||||
# RUN apk add --no-cache tzdata
|
|
||||||
|
|
||||||
# # Set the timezone to Asia/Tehran
|
|
||||||
# RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
|
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /temp-deps
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm install
|
RUN npm ci
|
||||||
|
|
||||||
|
FROM base AS prod-deps
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /build
|
WORKDIR /app
|
||||||
COPY . ./
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /temp-deps/node_modules ./node_modules
|
COPY . .
|
||||||
|
ENV NODE_ENV=production
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
RUN npm install --omit=dev
|
|
||||||
|
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NUXT_TELEMETRY_DISABLED=1
|
|
||||||
|
|
||||||
|
ENV NODE_ENV=production \
|
||||||
|
PORT=6096 \
|
||||||
|
HOSTNAME=0.0.0.0
|
||||||
|
|
||||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
RUN chown -R appuser:appgroup /app
|
|
||||||
|
|
||||||
# COPY --from=builder --chown=appuser:appgroup /build/.nuxt ./.nuxt
|
|
||||||
# COPY --from=builder --chown=appuser:appgroup /build/static ./static
|
|
||||||
# COPY --from=builder --chown=appuser:appgroup /build/package.json ./
|
|
||||||
# COPY --from=builder --chown=appuser:appgroup /build/node_modules/ ./node_modules/
|
|
||||||
COPY --from=builder --chown=appuser:appgroup /build ./
|
|
||||||
|
|
||||||
|
COPY --from=prod-deps --chown=appuser:appgroup /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/.nuxt ./.nuxt
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/static ./static
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/package.json ./package.json
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/nuxt.config.js ./nuxt.config.js
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/api ./api
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/store ./store
|
||||||
|
COPY --from=builder --chown=appuser:appgroup /app/middleware ./middleware
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
|
|
||||||
# Set environment variables
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV PORT=6096
|
|
||||||
ENV HOSTNAME="0.0.0.0"
|
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 6096
|
EXPOSE 6096
|
||||||
|
|
||||||
# Start the Nuxt 2 app
|
CMD ["node_modules/.bin/nuxt", "start"]
|
||||||
CMD ["npm", "start"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user