Skip to content
Snippets Groups Projects
development.md 1.71 KiB
Newer Older
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
# Development Guide

## Overview
Workspaces' services run on Docker containers. These containers can be all started at once using Docker Compose.

### Setup
Build the base image:
```sh
make docker-base
```
In the Makefile, this Docker command is run:
```sh
docker build -t ssa-containers.aoc.nrao.edu/ops/base:workspaces -f Dockerfile.base .
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
```

This builds a local Docker image tagged as `ssa-containers.aoc.nrao.edu/ops/base:workspaces` on your machine
using the `Dockerfile.base` Dockerfile.
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed

Once the image has been built, Docker will save this image on your machine. You do not need to run the `make docker-base`
command again unless you delete this image or modify the `Dockerfile.base` Dockerfile.
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed

### Starting Workspaces
To start Workspaces as foreground process, run:
```sh
docker-compose up
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
```

To start Workspaces as background process, run:
```sh
docker-compose up -d
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
```

### Stopping Workspaces
To stop Workspaces, run:
```sh
docker-compose down
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
```

### Starting Individual Services
To start Workspaces as foreground process, run:
```sh
docker-compose up <service_name>
Andrew Kapuscinski's avatar
Andrew Kapuscinski committed
```

### List Containers
To get a list of running containers:
```sh
docker container ls
```
Or:
```sh
docker ps
```

### Show Container Logs
To output logs of a specific container:
```sh
docker logs <container_name>
```

To continuously tail logs of a specific container:
```sh
docker logs -f <container_name>
```

### Open a Shell on a Running Container
Using Docker:
```sh
docker exec -it <container_name> bash
```

Using Docker Compose:
```sh
docker-compose exec <service_name> bash
```

### Run a command on a Running Container
Using Docker:
```sh
docker exec <container_name> pwd
```

Using Docker Compose:
```sh
docker-compose exec <service_name> pwd
```