Update Dockerfile

This commit is contained in:
alexsanderp
2022-02-04 10:50:08 -03:00
parent ea79c4da59
commit 2229ef9f9d
3 changed files with 49 additions and 17 deletions
+17 -13
View File
@@ -13,6 +13,19 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Install Docker Compose
run: |
python3 -m pip install docker-compose
- name: Install AWS CLI
run: |
python3 -m pip install awscli
.
- name: Configure AWS Region
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
- name: Extract Environment
shell: bash
run: |
@@ -23,24 +36,15 @@ jobs:
fi
id: extract_environment
- name: Configure AWS Region
uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-1
- name: Install AWS CLI
run: |
python3 -m pip install awscli
- name: Login to AWS ECR
id: login_ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, Tag, and Push Image to AWS ECR
env:
ECR_REGISTRY: ${{ steps.login_ecr.outputs.registry }}
ECR_REPOSITORY: microservices/maestro_${{ steps.extract_environment.outputs.result }}
IMAGE_TAG: latest
ENV: ${{ steps.extract_environment.outputs.result }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
export ENV=$ENV
docker-compose build
docker-compose push
+4 -4
View File
@@ -1,12 +1,12 @@
FROM node:14 as node_modules
WORKDIR /node_modules
FROM node:14 as packages
WORKDIR /packages
COPY package.json .
RUN npm install
FROM node:14-alpine
FROM node:alpine
WORKDIR /app
COPY . /app/
COPY --from=node_modules /node_modules /app/node_modules
COPY --from=packages /packages/node_modules /app/node_modules
RUN npm run build
EXPOSE 3333
ENTRYPOINT npm run start
+28
View File
@@ -0,0 +1,28 @@
version: "3.8"
services:
maestro:
build: .
image: 468720548566.dkr.ecr.us-east-1.amazonaws.com/microservices/maestro_${ENV}:latest
container_name: maestro
restart: always
ports:
- 3333:3333
node_exporter:
image: prom/node-exporter:v1.3.1
container_name: node_exporter
restart: always
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
- /run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro
command:
- '--path.procfs=/host/proc'
- '--path.rootfs=/rootfs'
- '--path.sysfs=/host/sys'
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
- '--collector.systemd'
- '--collector.processes'
network_mode: host
pid: host