Skip to content

Commit

Permalink
ajusta configuracoes do docker
Browse files Browse the repository at this point in the history
  • Loading branch information
HenriqueAmorim20 committed Nov 7, 2023
1 parent 7f7db7b commit caacffd
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 240 deletions.
3 changes: 3 additions & 0 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

npm run start
6 changes: 6 additions & 0 deletions .docker/entrypoint.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

echo ".................................."

echo "Running unit tests"
npm run test
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.github
.vscode
sonar-project.properties
parser.py
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
FROM node:18.17.0-alpine as BUILD_NODE_MODULES
FROM node:18.17.0-alpine

RUN apk update && apk add curl bash make && rm -rf /var/cache/apk/*

WORKDIR /home/node/app
WORKDIR /app

RUN npm i -g --unsafe-perm --allow-root -g expo-cli@6.3.10
RUN npm i -g --unsafe-perm --allow-root -g expo-cli@6.3.10 @expo/ngrok@4.1.0

COPY package*.json ./

RUN npm ci --legacy-peer-deps

COPY . .

FROM node:18.17.0-alpine

ENV NODE_ENV=production

WORKDIR /app

COPY --chown=node:node ./ /app
COPY --chown=node:node --from=BUILD_NODE_MODULES /home/node/app/node_modules /app/node_modules
RUN chmod +x /app/.docker/entrypoint.sh

USER node

EXPOSE 8081

ENTRYPOINT ["npm"]
CMD ["start"]
ENTRYPOINT ["/app/.docker/entrypoint.sh"]
13 changes: 13 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.7'
services:
gerocuidado-front-test:
build:
context: .
dockerfile: Dockerfile
container_name: gerocuidado-front-test
ports:
- '8081:8081'
volumes:
- ./:/app
- /app/node_modules
entrypoint: ./.docker/entrypoint.test.sh
7 changes: 5 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
version: '3.7'
services:
gerocuidado-usuario-front:
gerocuidado-front:
build:
context: .
dockerfile: Dockerfile
container_name: gerocuidado-usuario-front
container_name: gerocuidado-front
ports:
- '8081:8081'
volumes:
- ./:/app
- /app/node_modules
environment:
- EXPO_DEVTOOLS_LISTEN_ADDRESS=0.0.0.0
- NODE_ENV=${NODE_ENV}
227 changes: 12 additions & 215 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"version": "1.0.0",
"main": "expo-router/entry",
"scripts": {
"start": "NODE_ENV=development expo start",
"android": "NODE_ENV=development expo start --android",
"ios": "NODE_ENV=development expo start --ios",
"web": "NODE_ENV=development expo start --web",
"start:prod": "NODE_ENV=production expo start --tunnel",
"android:prod": "NODE_ENV=production expo start --android",
"ios:prod": "NODE_ENV=production expo start --ios",
"web:prod": "NODE_ENV=production expo start --web",
"test": "jest",
"start": "expo start",
"start:tunnel": "expo start --tunnel",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --forceExit --detectOpenHandles --colors --coverage",
"lint": "eslint . --fix"
},
"dependencies": {
Expand Down

0 comments on commit caacffd

Please sign in to comment.