mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-11 18:39:08 +00:00
Update Dockerfile
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user