Skip to content

docker-env test

docker-env test #1

Workflow file for this run

name: Test Docker Environment
on:
pull_request:
branches:
- main
jobs:
test-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker
run: |
docker --version
docker-compose --version
- name: Build Docker image
run: |
docker build -t my-app .
- name: Run Docker container
run: |
docker run -d --name my-container my-app
- name: Run tests inside Docker container
run: |
docker exec my-container npm test
- name: Clean up
run: |
docker stop my-container
docker rm my-container