-
Notifications
You must be signed in to change notification settings - Fork 0
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
69c7211
commit 355468d
Showing
7 changed files
with
69 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,38 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY package.json . | ||
COPY package-lock.json . | ||
RUN npm ci | ||
|
||
# Copy source files | ||
COPY . . | ||
|
||
# Build TypeScript | ||
RUN npm run build | ||
|
||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Copy built files | ||
COPY --from=0 /app/dist ./dist | ||
|
||
# Set environment variables | ||
ENV NODE_ENV=production | ||
|
||
# Install dependencies | ||
COPY package.json . | ||
COPY package-lock.json . | ||
RUN npm ci | ||
|
||
# Install PM2 | ||
RUN npm install -g pm2 | ||
|
||
# Expose port according to the environment | ||
EXPOSE 8000 | ||
|
||
# Start the app | ||
CMD ["pm2-runtime", "dist/index.js"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,12 @@ | ||
import dotenv from 'dotenv'; | ||
|
||
// Get environment variables | ||
dotenv.config(); | ||
|
||
const config = { | ||
port: parseInt(process.env.PORT as string, 10) || 8000, | ||
host: process.env.HOST || '0.0.0.0', | ||
environment: process.env.NODE_ENV || 'development' | ||
}; | ||
|
||
export default config; |
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