Skip to content

Commit c8bce36

Browse files
try new docker app layout
Signed-off-by: Marc Dumais <[email protected]>
1 parent e056db8 commit c8bce36

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

.github/workflows/docker-example.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
os: [ubuntu-latest]
1919
node-version: [18]
2020
params:
21-
- name: "theia-ext"
22-
folder: "theia-app-theia-ext"
23-
- name: "vscode-ext"
24-
folder: "theia-app-vscode-ext"
21+
- name: "tate"
22+
resources-folder: "theia-app-theia-ext"
23+
- name: "tave"
24+
resources-folder: "theia-app-vscode-ext"
2525

2626
steps:
2727
- uses: actions/checkout@v4
@@ -40,7 +40,7 @@ jobs:
4040
retry_on: error
4141
command: |
4242
cd docker
43-
docker build . --build-arg APP_SUBFOLDER=${{ matrix.params.folder }} -t tte-${{ matrix.params.name }} -f ${{ matrix.params.folder }}/Dockerfile
43+
docker build . --build-arg RESOURCES=${{ matrix.params.resources-folder }} -t tte-${{ matrix.params.name }} -f Dockerfile-${{ matrix.params.name }}
4444
on_retry_command: cd ../..
4545

4646
- name: Run docker image
@@ -51,5 +51,5 @@ jobs:
5151
run: |
5252
yarn --ignore-scripts
5353
cd docker
54-
yarn --cwd ${{ matrix.params.folder }} test
54+
yarn --cwd ${{ matrix.params.resources-folder }} test
5555
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM node:18.20.4-bookworm-slim AS build
2-
ARG APP_SUBFOLDER
2+
ARG RESOURCES
33

44
RUN apt-get update && apt-get install -y \
55
git \
@@ -12,8 +12,8 @@ RUN apt-get update && apt-get install -y \
1212
libxkbfile-dev
1313

1414
# Build the browser theia-trace-extension application
15-
COPY ${APP_SUBFOLDER}/package.json /app/tte/
16-
COPY ${APP_SUBFOLDER}/webpack.config.js /app/tte/
15+
COPY ${RESOURCES}/package.json /app/tte/
16+
COPY ${RESOURCES}/webpack.config.js /app/tte/
1717
COPY yarn.lock /app/tte/
1818
WORKDIR /app/tte/
1919
RUN yarn && \
@@ -27,7 +27,7 @@ RUN yarn && \
2727
du -hs /app/tte
2828

2929
FROM node:18.19.1-bookworm-slim
30-
ARG APP_SUBFOLDER
30+
ARG RESOURCES
3131

3232
COPY --from=build /app/tte /app/tte
3333

@@ -39,6 +39,6 @@ RUN apt-get update && apt-get install -y \
3939
ENV NODE_ENV=production
4040

4141
WORKDIR /app/tte
42-
COPY ${APP_SUBFOLDER}/docker-entrypoint.sh /usr/local/bin
42+
COPY ${RESOURCES}/docker-entrypoint.sh /usr/local/bin
4343
EXPOSE 4000
4444
ENTRYPOINT ["docker-entrypoint.sh"]
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM node:18.20.4-bookworm-slim AS build
2-
ARG APP_SUBFOLDER
2+
ARG RESOURCES
33

44
RUN apt-get update && apt-get install -y \
55
git \
@@ -12,8 +12,8 @@ RUN apt-get update && apt-get install -y \
1212
libxkbfile-dev
1313

1414
# Build the browser trace-extension application
15-
COPY ${APP_SUBFOLDER}/package.json /app/tte/
16-
COPY ${APP_SUBFOLDER}/webpack.config.js /app/tte/
15+
COPY ${RESOURCES}/package.json /app/tte/
16+
COPY ${RESOURCES}/webpack.config.js /app/tte/
1717
COPY yarn.lock /app/tte/
1818
WORKDIR /app/tte/
1919
RUN yarn && \
@@ -29,7 +29,7 @@ RUN yarn && \
2929
du -hs /app/tte
3030

3131
FROM node:18.19.1-bookworm-slim
32-
ARG APP_SUBFOLDER
32+
ARG RESOURCES
3333

3434
COPY --from=build /app/tte /app/tte
3535

@@ -41,6 +41,6 @@ RUN apt-get update && apt-get install -y \
4141
ENV NODE_ENV=production
4242

4343
WORKDIR /app/tte
44-
COPY ${APP_SUBFOLDER}/docker-entrypoint.sh /usr/local/bin
44+
COPY ${RESOURCES}/docker-entrypoint.sh /usr/local/bin
4545
EXPOSE 4000
4646
ENTRYPOINT ["docker-entrypoint.sh"]

docker/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
"devDependencies": {
99
},
1010
"scripts": {
11-
"prepare": "yarn vscodeExt",
12-
"build": "yarn theiaExt build && yarn vscodeExt build",
13-
"build:prod": "yarn theiaExt build:prod && yarn vscodeExt build:prod",
14-
"theiaExt": "yarn --cwd theia-app-theia-ext",
15-
"vscodeExt": "yarn --cwd theia-app-vscode-ext",
11+
"prepare": "yarn tave",
12+
"build": "yarn tate build && yarn tave build",
13+
"build:prod": "yarn tate build:prod && yarn tave build:prod",
14+
"tate": "yarn --cwd theia-app-theia-ext",
15+
"tave": "yarn --cwd theia-app-vscode-ext",
1616
"build:docker": "yarn build:docker:tate && yarn build:docker:tave",
17-
"build:docker:tate": "docker build --no-cache --network=host . --build-arg APP_SUBFOLDER=theia-app-theia-ext -t tte-theia-app-theia-ext -f theia-app-theia-ext/Dockerfile",
18-
"build:docker:tave": "docker build --no-cache --network=host . --build-arg APP_SUBFOLDER=theia-app-vscode-ext -t tte-theia-app-vscode-ext -f theia-app-vscode-ext/Dockerfile"
17+
"build:docker:tate": "docker build --no-cache --network=host . --build-arg RESOURCES=theia-app-theia-ext -t tte-tate -f Dockerfile-tate",
18+
"build:docker:tave": "docker build --no-cache --network=host . --build-arg RESOURCES=theia-app-vscode-ext -t tte-tave -f Dockerfile-tave"
1919
},
2020
"engines": {
2121
},

docker/theia-app-theia-ext/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Build the image and name it _tate_ (short for "theia application - theia extensi
1616
Try adding `--network host` in case of build failures related to debian packages retrieval:
1717

1818
```bash
19-
docker build -t tate .
19+
docker build -f Dockerfile-tate -t tate .
2020
```
2121

2222
Once the image has been built, start a container named _tate-1_ from

0 commit comments

Comments
 (0)