Skip to content

Commit 122659c

Browse files
authored
Add expose ports layer (#534)
With this PR, I’m adding a layer to the final image to expose the apps ports. This fixes the visibility of the applications when it’s run as a service in GitLab CI. There was a previous PR (#279) where these ports were added. However, during the CI/CD update (#444) they were removed, likely to keep the Dockerfile more universal.
1 parent df735c6 commit 122659c

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ jobs:
5858
runs-on: ubuntu-latest
5959
strategy:
6060
matrix:
61-
app:
62-
- pebble
63-
- pebble-challtestsrv
61+
include:
62+
- app: pebble
63+
expose_ports: "14000 15000"
64+
- app: pebble-challtestsrv
65+
expose_ports: "5001 5002 5003 8053 8055 8443"
6466
steps:
6567
- uses: actions/checkout@v5
6668
- name: Download ${{ matrix.app }} artifacts
@@ -96,7 +98,9 @@ jobs:
9698
- name: Build and push ${{ github.repository }}/${{ matrix.app }} for ${{ env.DOCKER_PLATFORMS }}
9799
uses: docker/build-push-action@v5
98100
with:
99-
build-args: APP=${{ matrix.app }}
101+
build-args: |
102+
APP=${{ matrix.app }}
103+
EXPOSE_PORTS=${{ matrix.expose_ports }}
100104
build-contexts: dist-files=/tmp/dist
101105
cache-from: type=gha
102106
cache-to: type=gha,mode=max

Dockerfile.release

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ ENTRYPOINT [ "/app.exe" ]
2727

2828
# Final stage: dynamically select between Linux and Windows stages based on TARGETOS argument
2929
FROM ${TARGETOS} AS final
30+
ARG EXPOSE_PORTS
31+
# Expose the specified ports
32+
EXPOSE ${EXPOSE_PORTS}
3033
# Add test configuration files
3134
COPY ./test/ /test/

0 commit comments

Comments
 (0)