Skip to content

Commit c2eba0e

Browse files
committed
Updated compose workflow
1 parent fdf72f1 commit c2eba0e

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

.env.local

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/docker-image.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Package publish
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*
9+
pull_request:
10+
env:
11+
IMAGE_NAME: deadline-web-app-frontend
12+
13+
jobs:
14+
push:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Build image
23+
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
24+
25+
- name: Log in to registry
26+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
27+
28+
- name: Push image
29+
run: |
30+
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
31+
32+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
33+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
34+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
35+
[ "$VERSION" == "main" ] && VERSION=latest
36+
echo IMAGE_ID=$IMAGE_ID
37+
echo VERSION=$VERSION
38+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
39+
docker push $IMAGE_ID:$VERSION

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ COPY . .
2727
# Uncomment the following line in case you want to disable telemetry during the build.
2828
# ENV NEXT_TELEMETRY_DISABLED 1
2929

30+
ARG NEXT_PUBLIC_BACKEND_URL
31+
ENV NEXT_PUBLIC_BACKEND_URL=${NEXT_PUBLIC_BACKEND_URL}
32+
3033
RUN \
3134
if [ -f yarn.lock ]; then yarn run build; \
3235
elif [ -f package-lock.json ]; then npm run build; \
@@ -58,10 +61,11 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
5861

5962
USER nextjs
6063

61-
EXPOSE 3000
64+
EXPOSE 80
6265

63-
ENV PORT 3000
66+
ENV PORT 80
6467

6568
# server.js is created by next build from the standalone output
6669
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
70+
6771
CMD HOSTNAME="0.0.0.0" node server.js

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.8'
2+
services:
3+
deadline-web-app-frontend:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
args:
8+
NEXT_PUBLIC_BACKEND_URL: wss://your_backend_url
9+
ports:
10+
- "2000:80"

0 commit comments

Comments
 (0)