Skip to content

Commit 526103c

Browse files
feat: added dockerfile and compose setup for admin-portal build (#9674)
* feat: added dockerfile and compose setup for admin-portal build * refactor: changed docker setup to run yarn on start instead of build * chore: moved docker compose file to root * feat: separated node modules folders from container * it works on my machine :D --------- Co-authored-by: Josh Balfour <[email protected]>
1 parent e2d5456 commit 526103c

9 files changed

+34
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,5 @@ bundle.zip
9898
cdk.context.json
9999

100100
packages/cognito-custom-mail-lambda/**/*.html
101+
102+
.tmp
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

docker-compose.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: '3'
2+
x-node: &node
3+
build:
4+
context: ./docker
5+
working_dir: /foundations
6+
volumes:
7+
- .:/foundations
8+
# Uncomment the line below if you need to view yarn's build logs or such
9+
# - ./.tmp:/tmp
10+
environment:
11+
- NPM_TOKEN=${NPM_TOKEN}
12+
13+
x-dont-start-by-default: &dontstart
14+
profiles: ["dont-start-by-default"]
15+
16+
services:
17+
yarn:
18+
<<: *node
19+
command: yarn
20+
admin-portal:
21+
<<: [*dontstart, *node]
22+
working_dir: /foundations/packages/admin-portal
23+
ports:
24+
- "8080:8080"
25+
environment:
26+
- NPM_TOKEN=${NPM_TOKEN}
27+
depends_on:
28+
yarn:
29+
condition: service_completed_successfully
30+
command: yarn start

docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM node:lts
2+
RUN npm explore npm/node_modules/@npmcli/run-script -g -- npm_config_global=false npm install node-gyp@latest

0 commit comments

Comments
 (0)