Skip to content

Commit dae3709

Browse files
committed
single Dockerfile shared by all pckages
Signed-off-by: Miroslav Bajtoš <[email protected]>
1 parent 6e7af32 commit dae3709

File tree

6 files changed

+20
-18
lines changed

6 files changed

+20
-18
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,19 @@ jobs:
7676
username: ${{ github.actor }}
7777
password: ${{ secrets.GITHUB_TOKEN }}
7878

79-
- name: Build the base Docker image
80-
uses: docker/build-push-action@v5
81-
with:
82-
context: .
83-
cache-from: type=registry,ref=ghcr.io/filecoin-station/core
84-
cache-to: type=inline
85-
tags: spark-api-base
86-
8779
- name: Build spark-api Docker image
8880
uses: docker/build-push-action@v5
8981
with:
90-
context: spark-api
82+
context: .
83+
build-args: "SERVICE=api"
9184
cache-from: type=registry,ref=ghcr.io/filecoin-station/core
9285
cache-to: type=inline
9386

9487
- name: Build spark-publish Docker image
9588
uses: docker/build-push-action@v5
9689
with:
97-
context: spark-publish
90+
context: .
91+
build-args: "SERVICE=publish"
9892
cache-from: type=registry,ref=ghcr.io/filecoin-station/core
9993
cache-to: type=inline
10094

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,13 @@ FROM base
3737

3838
# Copy built application
3939
COPY --from=build /app /app
40+
41+
# Set to `publish` or `api`
42+
# This argument controls what npm script is executed as the CMD.
43+
ARG SERVICE
44+
45+
# ARGs are not preserved at runtime, we need to store the value
46+
# as a default value of an ENV var
47+
ENV SCRIPT="start:${SERVICE}"
48+
49+
CMD npm run ${SCRIPT}

spark-api/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

spark-api/fly.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ processes = []
1313
DOMAIN = "api.filspark.com"
1414
REQUEST_LOGGING = "false"
1515

16+
[build.args]
17+
SERVICE=api
18+
1619
[experimental]
1720
auto_rollback = true
1821

spark-publish/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

spark-publish/fly.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@ primary_region = "cdg"
55
SENTRY_ENVIRONMENT="production"
66
MAX_MEASUREMENTS_PER_ROUND="100000"
77

8+
[build.args]
9+
SERVICE=api
10+
811
[deploy]
912
strategy = "rolling"

0 commit comments

Comments
 (0)