Skip to content

Commit

Permalink
Merge pull request #19 from davewalker5/volume-mount-point
Browse files Browse the repository at this point in the history
Remove application version from mount point names in Docker container
  • Loading branch information
davewalker5 authored Aug 19, 2024
2 parents 41431ee + 79a6df3 commit 042a41c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 67 deletions.
4 changes: 2 additions & 2 deletions docker/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:latest
COPY droneflightlog.api-1.3.0.0 /opt/droneflightlog.api-1.3.0.0
WORKDIR /opt/droneflightlog.api-1.3.0.0/bin
COPY droneflightlog.api-1.4.0.0 /opt/droneflightlog.api
WORKDIR /opt/droneflightlog.api/bin
ENTRYPOINT [ "./DroneFlightLog.Api" ]
26 changes: 8 additions & 18 deletions docker/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ In order to run this image you'll need docker installed.

The following "docker run" parameters are recommended when running the droneflightlogapisqlite image:

| Parameter | Value | Purpose |
| --------- | ------------------------------------------ | ------------------------------------------------------- |
| -d | - | Run as a background process |
| -v | /local:/var/opt/droneflightlog.api-1.0.0.4 | Mount the host folder containing the SQLite database |
| -p | 5001:80 | Expose the container's port 80 as port 5001 on the host |
| --rm | - | Remove the container automatically when it stops |
| Parameter | Value | Purpose |
| --------- | ---------------------------------- | ------------------------------------------------------- |
| -d | - | Run as a background process |
| -v | /local:/var/opt/droneflightlog.api | Mount the host folder containing the SQLite database |
| -p | 5001:80 | Expose the container's port 80 as port 5001 on the host |
| --rm | - | Remove the container automatically when it stops |

For example:

```shell
docker run -d -v /local:/var/opt/droneflightlog.api-1.0.0.4/ -p 5001:80 --rm davewalker5/droneflightlogapisqlite:latest
docker run -d -v /local:/var/opt/droneflightlog.api/ -p 5001:80 --rm davewalker5/droneflightlogapisqlite:latest
```

The "/local" path given to the -v argument is described, below, and should be replaced with a value appropriate for the host running the container. Similarly, the port number "5001" can be replaced with any available port on the host.
Expand All @@ -57,7 +57,7 @@ The folder containing the "droneflightlog.db" file can then be passed to the "do
To run the image, enter the following command, substituting "/local" for the host folder containing the SQLite database, as described:

```shell
docker run -d -v /local:/var/opt/droneflightlog.api-1.0.0.4/ -p 5001:80 --rm davewalker5/droneflightlogapisqlite:latest
docker run -d -v /local:/var/opt/droneflightlog.api/ -p 5001:80 --rm davewalker5/droneflightlogapisqlite:latest
```

Once the container is running, browse to the following URL on the host:
Expand All @@ -66,16 +66,6 @@ http://localhost:5001

You should see the Swagger API documentation for the API.

## Built With

The droneflightlogapisqlite image was been built with the following:

| Aspect | Version |
| -------------- | ---------------------- |
| .NET Core CLI | 3.1.101 |
| Target Runtime | linux-x64 |
| Docker Desktop | 19.03.5, build 633a0ea |

## Find Us

- [DroneFlightLogDb on GitHub](https://github.com/davewalker5/DroneFlightLogDb)
Expand Down
4 changes: 2 additions & 2 deletions docker/ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:latest
COPY droneflightlog.mvc-1.2.0.0 /opt/droneflightlog.mvc-1.2.0.0
WORKDIR /opt/droneflightlog.mvc-1.2.0.0/bin
COPY droneflightlog.mvc-1.4.0.0 /opt/droneflightlog.mvc
WORKDIR /opt/droneflightlog.mvc/bin
ENTRYPOINT [ "./DroneFlightLog.Mvc" ]
68 changes: 29 additions & 39 deletions docker/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

The Drone Flight Log is a personal UAV flight logging application implemented using .NET Core. It has the following components:

| Name | GitHub | Comments |
| --- | --- | --- |
| DroneFlightLogDb | [DroneFlightLogDb](https://github.com/davewalker5/DroneFlightLogDb) | Business logic, entities and database implementation |
| DroneFlightLog.Api | [DroneFlightLog.Api](https://github.com/davewalker5/DroneFlightLog.Api) | REST API for reading and writing to the database |
| Name | GitHub | Comments |
| ------------------ | ----------------------------------------------------------------------- | --------------------------------------------------------- |
| DroneFlightLogDb | [DroneFlightLogDb](https://github.com/davewalker5/DroneFlightLogDb) | Business logic, entities and database implementation |
| DroneFlightLog.Api | [DroneFlightLog.Api](https://github.com/davewalker5/DroneFlightLog.Api) | REST API for reading and writing to the database |
| DroneFlightLog.Mvc | [DroneFlightLog.Mvc](https://github.com/davewalker5/DroneFlightLog.Mvc) | ASP.NET MVC UI for accessing the database via the service |

The application provides facilities for recording and querying the following data:

* Operator details
* Drones, models and manufacturers
* Flights, flight locations and flight properties
- Operator details
- Drones, models and manufacturers
- Flights, flight locations and flight properties

The droneflightlogmvc image contains a build of the web-based MVC user interface.

Expand All @@ -22,24 +22,24 @@ The droneflightlogmvc image contains a build of the web-based MVC user interface

In order to run this image you'll need docker installed.

* [Windows](https://docs.docker.com/windows/started)
* [OS X](https://docs.docker.com/mac/started/)
* [Linux](https://docs.docker.com/linux/started/)
- [Windows](https://docs.docker.com/windows/started)
- [OS X](https://docs.docker.com/mac/started/)
- [Linux](https://docs.docker.com/linux/started/)

### Usage

#### Service Container Parameters

An instance of the dronefilghtlogapisqlite image must be started first in order for the UI to work. The recommended parameters are:

| Parameter | Value | Purpose |
| --- | --- | --- |
| -d | - | Run as a background process
| -v | /local:/var/opt/droneflightlog.api-1.0.0.3 | Mount the host folder containing the SQLite database |
| --name | droneflightlogservice | Name the service so the UI can find it |
| --rm | - | Remove the container automatically when it stops |
| Parameter | Value | Purpose |
| --------- | ---------------------------------- | ---------------------------------------------------- |
| -d | - | Run as a background process |
| -v | /local:/var/opt/droneflightlog.api | Mount the host folder containing the SQLite database |
| --name | droneflightlogservice | Name the service so the UI can find it |
| --rm | - | Remove the container automatically when it stops |

The "/local" path given to the -v argument is described, below, and should be replaced with a value appropriate for the host running the container.
The "/local" path given to the -v argument is described, below, and should be replaced with a value appropriate for the host running the container.

The "--name" parameter is mandatory as the service URL is held in the application settings for the UI image and is expected to be:

Expand All @@ -49,12 +49,12 @@ http://droneflightlogservice:80

The following "docker run" parameters are recommended when running the droneflightlogmvc image:

| Parameter | Value | Purpose |
| --- | --- | --- |
| -d | - | Run as a background process
| -p | 5001:80 | Expose the container's port 80 as port 5001 on the host |
| --link | droneflightlogservice | Link to the drone flight log service container |
| --rm | - | Remove the container automatically when it stops |
| Parameter | Value | Purpose |
| --------- | --------------------- | ------------------------------------------------------- |
| -d | - | Run as a background process |
| -p | 5001:80 | Expose the container's port 80 as port 5001 on the host |
| --link | droneflightlogservice | Link to the drone flight log service container |
| --rm | - | Remove the container automatically when it stops |

For example:

Expand Down Expand Up @@ -82,7 +82,7 @@ The folder containing the "droneflightlog.db" file can then be passed to the "do
To run the images for the service and UI, enter the following commands, substituting "/local" for the host folder containing the SQLite database, as described:

```shell
docker run -d -v /local:/var/opt/droneflightlog.api-1.0.0.3/ --name droneflightlogservice --rm davewalker5/droneflightlogapisqlite:latest
docker run -d -v /local:/var/opt/droneflightlog.api/ --name droneflightlogservice --rm davewalker5/droneflightlogapisqlite:latest
docker run -d -p 5001:80 --rm --link droneflightlogservice davewalker5/droneflightlogmvc:latest
```

Expand All @@ -92,31 +92,21 @@ http://localhost:5001

You should see the login page for the UI.

## Built With

The droneflightlogmvc image was been built with the following:

| Aspect | Version |
| --- | --- |
| .NET Core CLI | 3.1.101 |
| Target Runtime | linux-x64 |
| Docker Desktop | 19.03.5, build 633a0ea |

## Find Us

* [DroneFlightLogDb on GitHub](https://github.com/davewalker5/DroneFlightLogDb)
* [DroneFlightLog.Api on GitHub](https://github.com/davewalker5/DroneFlightLog.Api)
* [DroneFlightLog.Mvc on GitHub](https://github.com/davewalker5/DroneFlightLog.Mvc)
- [DroneFlightLogDb on GitHub](https://github.com/davewalker5/DroneFlightLogDb)
- [DroneFlightLog.Api on GitHub](https://github.com/davewalker5/DroneFlightLog.Api)
- [DroneFlightLog.Mvc on GitHub](https://github.com/davewalker5/DroneFlightLog.Mvc)

## Versioning

For the versions available, see the [tags on this repository](https://github.com/davewalker5/DroneFlightLog.Mvc/tags).

## Authors

* **Dave Walker** - *Initial work* - [LinkedIn](https://www.linkedin.com/in/davewalker5/)
- **Dave Walker** - _Initial work_ - [LinkedIn](https://www.linkedin.com/in/davewalker5/)

See also the list of [contributors](https://github.com/davewalker5/DroneFlightLog.Mvc/contributors) who
See also the list of [contributors](https://github.com/davewalker5/DroneFlightLog.Mvc/contributors) who
participated in this project.

## License
Expand Down
6 changes: 3 additions & 3 deletions src/DroneFlightLog.Api/DroneFlightLog.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ReleaseVersion>1.2.2.0</ReleaseVersion>
<FileVersion>1.2.2.0</FileVersion>
<ProductVersion>1.2.2.0</ProductVersion>
<ReleaseVersion>1.4.0.0</ReleaseVersion>
<FileVersion>1.4.0.0</FileVersion>
<ProductVersion>1.4.0.0</ProductVersion>
<Configurations>Release;Debug</Configurations>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/DroneFlightLog.Mvc/DroneFlightLog.Mvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ReleaseVersion>1.1.5.0</ReleaseVersion>
<FileVersion>1.1.5.0</FileVersion>
<ProductVersion>1.1.5.0</ProductVersion>
<ReleaseVersion>1.4.0.0</ReleaseVersion>
<FileVersion>1.4.0.0</FileVersion>
<ProductVersion>1.4.0.0</ProductVersion>
<Configurations>Release;Debug</Configurations>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down

0 comments on commit 042a41c

Please sign in to comment.