-
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
Showing
9 changed files
with
217 additions
and
11 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
dist | ||
*.log | ||
*.md | ||
.git |
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,47 @@ | ||
# This Dockerfile is for running the app in production. It must be connected to | ||
# Redis with docker-compose.yml. | ||
|
||
# Use an Oracle Instant Client base image | ||
FROM oraclelinux:8 AS oracle-client | ||
|
||
# Install Oracle Instant Client via Oracle's YUM repository | ||
RUN dnf install -y oracle-instantclient-release-el8 && \ | ||
dnf install -y oracle-instantclient-basic | ||
|
||
# Use the official Node.js image as the base image | ||
FROM node:18 | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Install dependencies for OracleDB | ||
RUN apt-get update && apt-get install -y \ | ||
libaio1 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy Oracle Instant Client from the previous stage | ||
COPY --from=oracle-client /usr/lib/oracle /usr/lib/oracle | ||
COPY --from=oracle-client /usr/share/oracle /usr/share/oracle | ||
|
||
# Set environment variables | ||
ENV LD_LIBRARY_PATH=/usr/lib/oracle/21/client64/lib | ||
ENV TNS_ADMIN=/usr/lib/oracle/21/client64/network/admin | ||
ENV PATH="$PATH:/usr/lib/oracle/21/client64/bin" | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install the application dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the application files | ||
COPY . . | ||
|
||
# Build the NestJS application | ||
RUN npm run build | ||
|
||
# Expose the application port | ||
EXPOSE 3004 | ||
|
||
# Command to run the application | ||
CMD ["node", "dist/main"] |
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,47 @@ | ||
# This file is for running any npm commands in docker. It is connected to redis | ||
# with docker-compose.npm-run.yml. | ||
|
||
# Use an Oracle Instant Client base image | ||
FROM oraclelinux:8 AS oracle-client | ||
|
||
# Install Oracle Instant Client via Oracle's YUM repository | ||
RUN dnf install -y oracle-instantclient-release-el8 && \ | ||
dnf install -y oracle-instantclient-basic | ||
|
||
# Use the official Node.js image as the base image | ||
FROM node:18 | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /app | ||
|
||
# Install dependencies for OracleDB | ||
RUN apt-get update && apt-get install -y \ | ||
libaio1 && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy Oracle Instant Client from the previous stage | ||
COPY --from=oracle-client /usr/lib/oracle /usr/lib/oracle | ||
COPY --from=oracle-client /usr/share/oracle /usr/share/oracle | ||
|
||
# Set environment variables | ||
ENV LD_LIBRARY_PATH=/usr/lib/oracle/21/client64/lib | ||
ENV TNS_ADMIN=/usr/lib/oracle/21/client64/network/admin | ||
ENV PATH="$PATH:/usr/lib/oracle/21/client64/bin" | ||
|
||
# Copy package.json and package-lock.json to the working directory | ||
COPY package*.json ./ | ||
|
||
# Install the application dependencies | ||
RUN npm ci | ||
|
||
# Copy the rest of the application files | ||
COPY . . | ||
|
||
# Build the NestJS application | ||
RUN npm run build | ||
|
||
# Expose the application port | ||
EXPOSE 3004 | ||
|
||
# Command to run the application | ||
ENTRYPOINT ["npm"] |
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,34 @@ | ||
# This file is for running any npm commands in docker. | ||
|
||
version: "3.8" | ||
|
||
services: | ||
npm-run: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.npm-run | ||
ports: | ||
- "3004:3004" # Default to 3004 if PORT is not set | ||
#- "${PORT:-3004}:3004" # Default to 3004 if PORT is not set | ||
environment: | ||
- REDIS_URL=redis://redis:6379 | ||
volumes: | ||
- .:/usr/src/app | ||
networks: | ||
- backend | ||
depends_on: | ||
- redis | ||
entrypoint: ["npm", "run"] # Always run `npm run` by default | ||
command: ["start:dev"] # Default argument (overridden if custom command given) | ||
|
||
redis: | ||
image: redis:latest | ||
restart: always | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- backend | ||
|
||
networks: | ||
backend: | ||
driver: bridge |
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,27 @@ | ||
# This file is for running the app in production | ||
version: "3.8" | ||
|
||
services: | ||
laji-api: | ||
build: . | ||
ports: | ||
- "0.0.0.0:${PORT:-3004}:3004" # Default to 3004 if PORT is not set | ||
#- "0.0.0.0:3004:3004" # Default to 3004 if PORT is not set | ||
environment: | ||
- REDIS_URL=redis://redis:6379 | ||
depends_on: | ||
- redis | ||
networks: | ||
- backend | ||
|
||
redis: | ||
image: redis:latest | ||
restart: always | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- backend | ||
|
||
networks: | ||
backend: | ||
driver: bridge |
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
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