forked from fga-eps-mds/2024.1-CALCULUS-StudioMaker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from fga-eps-mds/fix#42/fix-docker
[FIX] Modifica configurações do Docker da Aplicação (fga-eps-mds/2024.2-ARANDU-DOC#42)
- Loading branch information
Showing
10 changed files
with
109 additions
and
25 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
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,11 @@ | ||
MONGODB_URI= | ||
MONGO_INITDB_ROOT_USERNAME= | ||
MONGO_INITDB_ROOT_PASSWORD= | ||
ME_CONFIG_MONGODB_ADMINUSERNAME= | ||
ME_CONFIG_MONGODB_ADMINPASSWORD= | ||
ME_CONFIG_MONGODB_URL= | ||
ME_CONFIG_BASICAUTH= | ||
ME_CONFIG_BASICAUTH_USERNAME= | ||
ME_CONFIG_BASICAUTH_PASSWORD= | ||
USER_SERVICE_URL= | ||
AUTH_SERVICE_URL= |
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,11 @@ | ||
MONGODB_URI= | ||
MONGO_INITDB_ROOT_USERNAME= | ||
MONGO_INITDB_ROOT_PASSWORD= | ||
ME_CONFIG_MONGODB_ADMINUSERNAME= | ||
ME_CONFIG_MONGODB_ADMINPASSWORD= | ||
ME_CONFIG_MONGODB_URL= | ||
ME_CONFIG_BASICAUTH= | ||
ME_CONFIG_BASICAUTH_USERNAME= | ||
ME_CONFIG_BASICAUTH_PASSWORD= | ||
USER_SERVICE_URL= | ||
AUTH_SERVICE_URL= |
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 |
---|---|---|
@@ -1,14 +1,32 @@ | ||
FROM node:22-alpine | ||
FROM node:18 AS base | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json* ./ | ||
RUN \ | ||
if [ -f package-lock.json ]; then npm ci; \ | ||
fi | ||
|
||
COPY package*.json ./ | ||
RUN npm install nodemon --save-dev | ||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
COPY .env .env | ||
RUN npm run build | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=development | ||
|
||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/ ./ | ||
|
||
EXPOSE 3002 | ||
|
||
ENV PORT=3002 | ||
|
||
CMD ["npm", "run", "start:dev"] |
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,32 @@ | ||
FROM node:18 AS base | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json package-lock.json* ./ | ||
RUN \ | ||
if [ -f package-lock.json ]; then npm ci; \ | ||
fi | ||
|
||
RUN npm install nodemon --save-dev | ||
|
||
FROM base AS builder | ||
WORKDIR /app | ||
RUN npm install | ||
COPY . . | ||
|
||
COPY .env .env | ||
RUN npm run build | ||
|
||
FROM base AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
|
||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/ ./ | ||
|
||
EXPOSE 3002 | ||
|
||
ENV PORT=3002 | ||
|
||
CMD ["npm", "run", "start:prod"] |
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,15 @@ | ||
.PHONY: build | ||
build: | ||
npm install && docker-compose build --no-cache | ||
|
||
.PHONY: start | ||
start: | ||
docker-compose up | ||
|
||
.PHONY: run | ||
run: | ||
npm install && docker-compose build --no-cache && docker-compose up | ||
|
||
.PHONY: stop | ||
stop: | ||
docker-compose down |
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