-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixes missing
tsc
dependency (#586)
* fix: fixes missing `tsc` dependency installation in CI/CD when deploying socket.io server * fix: updates packages and yarn.lock files * fix: fixes yarn mismatch between local environment and docker * fix: solves conflict with main * fix: fixes the Dockerfile
- Loading branch information
1 parent
f373377
commit e2773a8
Showing
4 changed files
with
218 additions
and
306 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 |
---|---|---|
|
@@ -8,22 +8,26 @@ ARG NODE_ENV=production | |
ENV NODE_ENV=${NODE_ENV} | ||
|
||
WORKDIR /app | ||
|
||
# Install Yarn v3.5.1 | ||
RUN corepack enable | ||
# RUN corepack install [email protected] | ||
RUN corepack prepare [email protected] --activate | ||
|
||
# Verify yarn version | ||
RUN yarn --version | ||
|
||
COPY package.json ./ | ||
RUN yarn install | ||
COPY . . | ||
RUN yarn build | ||
COPY yarn.lock ./ | ||
|
||
# Runtime stage | ||
FROM node:18-alpine | ||
# Install all dependencies including devDependencies | ||
RUN yarn install --frozen-lockfile && npm install typescript -g | ||
|
||
WORKDIR /app | ||
COPY --from=builder /app/package.json ./ | ||
COPY . . | ||
|
||
# If NODE_ENV is development, install all dependencies, else only production dependencies | ||
RUN if [ "$NODE_ENV" = "development" ]; then yarn install; else yarn install --production; fi | ||
RUN yarn build | ||
|
||
COPY --from=builder /app/dist ./dist | ||
COPY .env ./ | ||
|
||
EXPOSE 4000 | ||
CMD ["node", "dist/index.js"] | ||
CMD ["node", "dist/index.js"] |
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
Oops, something went wrong.