Testing the OASIS API Docker Image

Quick Test

Run the full test suite:

./docker/test-local.sh

Or test with a specific image tag:

./docker/test-local.sh v20251219-151443

Manual Testing

1. Run the Container Locally

# Pull and run the image
docker run -d \
  --name oasis-api-test \
  -p 8080:80 \
  -v $(pwd)/OASIS_DNA.json:/app/OASIS_DNA.json:ro \
  -e ASPNETCORE_ENVIRONMENT=Development \
  881490134703.dkr.ecr.us-east-1.amazonaws.com/oasis-api:latest

2. Test Endpoints

3. Compare with Local API

Local API (runs on port 5000/5003):

Docker API (runs on port 8080):

4. View Logs

5. Test Key Functionality

Test the same endpoints on both:

  1. Swagger UI: Should be identical

  2. API Version: Should return same version info

  3. Avatar Endpoints: Should work the same way

  4. NFT Endpoints: Should work (NFTManager is included)

  5. Wallet Endpoints: Should work

6. Cleanup

Comparing Behavior

Expected Differences

  1. Environment: Docker runs in Production mode by default (can override with -e ASPNETCORE_ENVIRONMENT=Development)

  2. Port: Docker uses port 80 internally, mapped to 8080 locally

  3. Configuration: Uses OASIS_DNA.json from container or mounted volume

Should Be Identical

  1. API Endpoints: All endpoints should work the same

  2. Response Format: JSON responses should be identical

  3. Error Handling: Should behave the same way

  4. Swagger Documentation: Should be identical

Troubleshooting

Container won't start

API not responding

Missing OASIS_DNA.json

Production Testing

After testing locally, you can update the ECS service:

Then test the production API at your ECS service endpoint.

Last updated