Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	compose.yml
  • Loading branch information
mcdonnnj committed Feb 7, 2025
2 parents d7d73c7 + eafe720 commit 1c8ca20
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 26 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,16 +419,14 @@ jobs:
path: ${{ env.BUILDX_CACHE_DIR }}
restore-keys: |
${{ env.BASE_CACHE_KEY }}
- name: Create cross-platform support Dockerfile-x
run: ./buildx-dockerfile.sh
- name: Build and push platform images to registries
id: docker_build
uses: docker/build-push-action@v6
with:
cache-from: type=local,src=${{ env.BUILDX_CACHE_DIR }}
cache-to: type=local,dest=${{ env.BUILDX_CACHE_DIR }}
context: .
file: ./Dockerfile-x
file: ./Dockerfile
labels: ${{ needs.prepare.outputs.labels }}
platforms: |
linux/amd64
Expand Down
54 changes: 49 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ docker run cisagov/example:0.2.0

### Running with Docker Compose ###

<<<<<<< HEAD
1. Create a `docker-compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/)
or use the [sample `docker-compose.yml`](docker-compose.yml) provided with
this repository.
=======
1. Create a `compose.yml` file similar to the one below to use [Docker Compose](https://docs.docker.com/compose/).
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5
```yaml
---
version: "3.7"
name: skeleton-docker

services:
<<<<<<< HEAD
Expand All @@ -52,6 +56,7 @@ this repository.
restart: always
=======
example:
<<<<<<< HEAD
image: cisagov/example:0.2.0
volumes:
- type: bind
Expand Down Expand Up @@ -85,6 +90,19 @@ this repository.
driver: default
config:
- subnet: 172.16.202.0/24
=======
environment:
- ECHO_MESSAGE="Hello from docker compose"
image: cisagov/example:0.2.0
ports:
- protocol: tcp
published: "8080"
target: 8080
volumes:
- source: <your_log_dir>
target: /var/log
type: bind
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5
```

1. Start the container and detach:
Expand All @@ -107,11 +125,15 @@ environment variables. See the
- `privkey.pem`
- `users.txt`

<<<<<<< HEAD
1. Then add the secrets to your `docker-compose.yml` file:
=======
1. Then add the secret to your `compose.yml` file:
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5

```yaml
---
version: "3.7"
name: skeleton-docker

secrets:
fullchain_pem:
Expand All @@ -134,6 +156,7 @@ environment variables. See the
restart: always
=======
example:
<<<<<<< HEAD
image: cisagov/example:0.2.0
volumes:
- type: bind
Expand Down Expand Up @@ -174,6 +197,22 @@ environment variables. See the
driver: default
config:
- subnet: 172.16.202.0/24
=======
environment:
- ECHO_MESSAGE="Hello from docker compose"
image: cisagov/example:0.2.0
ports:
- protocol: tcp
published: "8080"
target: 8080
secrets:
- source: quote_txt
target: quote.txt
volumes:
- source: <your_log_dir>
target: /var/log
type: bind
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5
```

## Updating your container ##
Expand Down Expand Up @@ -237,9 +276,9 @@ If you want to add or remove dependencies you would update the `src/Pipfile` fil
and then update dependencies as you would above.

> [!NOTE]
> You should only specify packages that are explicitly needed for your Docker
> configuration. Allow [Pipenv] to manage the dependencies of the specified
> packages.
> You should only specify packages that are direct requirements of
> your Docker configuration. Allow [Pipenv] to manage the dependencies
> of the specified packages.
## Image tags ##

Expand Down Expand Up @@ -290,8 +329,13 @@ The following ports are exposed by this container:
| 587 | Mail submission |
| 993 | IMAPS |

<<<<<<< HEAD
The sample [Docker composition](docker-compose.yml) publishes the
exposed ports at 1025, 1587, and 1993, respectively.
=======
The sample [Docker composition](compose.yml) publishes the
exposed port at 8080.
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5
## Environment variables ##

Expand Down
15 changes: 0 additions & 15 deletions buildx-dockerfile.sh

This file was deleted.

26 changes: 23 additions & 3 deletions docker-compose.yml → compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
version: "3.7"

# This Docker composition file is used to build and test the container

name: skeleton-docker

secrets:
fullchain_pem:
file: ./src/secrets/fullchain.pem
Expand All @@ -19,6 +19,7 @@ services:
# e.g., --build-arg VERSION=0.0.1
context: .
dockerfile: Dockerfile
<<<<<<< HEAD:docker-compose.yml
image: cisagov/postfix
init: true
restart: always
Expand All @@ -44,8 +45,18 @@ services:
- target: 8421
published: 8421
>>>>>>> 0d48ebd47a28a887868ea3093e675e95f3843561
=======
environment:
- ECHO_MESSAGE=Hello World from docker compose!
image: cisagov/example
init: true
ports:
- mode: host
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5:compose.yml
protocol: tcp
mode: host
published: "8421"
target: 8421
restart: "no"
secrets:
- source: fullchain_pem
target: fullchain.pem
Expand All @@ -54,10 +65,19 @@ services:
- source: users_txt
target: users.txt

<<<<<<< HEAD:docker-compose.yml
networks:
front:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.202.0/24
=======
example-version:
# Run the container to collect version information
command: --version
image: cisagov/example
init: true
restart: "no"
>>>>>>> eafe720594319b9503bd5e6d7e5b59e61ff9d6d5:compose.yml
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--requirement requirements-test.txt
ipython
pipenv
# The bump-version script requires at least version 3 of semver.
semver>=3

0 comments on commit 1c8ca20

Please sign in to comment.