Skip to content

Commit

Permalink
feat: add pnpm and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lishoulong committed May 27, 2024
1 parent 220519a commit 29b698f
Show file tree
Hide file tree
Showing 6 changed files with 7,084 additions and 12,265 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ pnpm-debug.log*
!.yarn/sdks
!.yarn/versions
.pnp.*

logs
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ WORKDIR /app

# Set production environment
ENV NODE_ENV="production"

# Install pnpm
ARG PNPM_VERSION=9.1.2
RUN npm install -g pnpm@$PNPM_VERSION

# Throw-away build stage to reduce size of final image
FROM base as build
Expand All @@ -21,17 +23,16 @@ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3

# Install node modules
COPY --link .npmrc package-lock.json package.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --include=dev
COPY --link package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod=false

# Copy application code
COPY --link . .

# Build application
RUN npm run build
RUN pnpm run build

# Remove development dependencies
RUN npm prune --omit=dev
RUN pnpm prune --prod


# Final stage for app image
Expand All @@ -42,4 +43,4 @@ COPY --from=build /app/dist /usr/share/nginx/html

# Start the server by default, this can be overwritten at runtime
EXPOSE 80
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]
CMD [ "/usr/sbin/nginx", "-g", "daemon off;" ]
4 changes: 2 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# fly.toml app configuration file generated for fred-astro-paper-ancient-voice-349 on 2024-05-26T10:55:09+08:00
# fly.toml app configuration file generated for fred-astro-paper-blue-dew-19 on 2024-05-27T12:14:27+08:00
#
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
#

app = 'fred-astro-paper-ancient-voice-349'
app = 'fred-astro-paper-blue-dew-19'
primary_region = 'hkg'

[build]
Expand Down
Loading

0 comments on commit 29b698f

Please sign in to comment.