'test build'
3 files changed, +18 -9
+0-7Client/dockerfile
| @@ -1,7 +0,0 @@ | ||
| 1 | -FROM node:20 | |
| 2 | -WORKDIR /code | |
| 3 | -COPY package.json . | |
| 4 | -RUN npm i | |
| 5 | -COPY . . | |
| 6 | -RUN npm run build | |
| 7 | -CMD [""] |
+12-1buildspec.yml
| @@ -3,6 +3,7 @@ version: 0.2 | ||
| 3 | 3 | env: |
| 4 | 4 | variables: |
| 5 | 5 | REACT_APP_BASE_URL: "http://localhost:5001/" |
| 6 | + CLOUDFRONT_ID: "E1VDTBR7TV8GO0" | |
| 6 | 7 | |
| 7 | 8 | phases: |
| 8 | 9 | install: |
| @@ -10,6 +11,15 @@ phases: | ||
| 10 | 11 | - echo Installing dependencies... |
| 11 | 12 | - cd Client && npm i |
| 12 | 13 | - cd ../server && npm i |
| 14 | + - echo Ensuring artifact bucket | |
| 15 | + - aws s3api create-bucket --bucket hygo.real-e-state.artifacts --create-bucket-configuration LocationConstraint=us-west-1 | |
| 16 | + - echo Ensuring cache bucket | |
| 17 | + - aws s3api create-bucket --bucket hygo.real-e-state.cache --create-bucket-configuration LocationConstraint=us-west-1 | |
| 18 | + - echo Ensuring frontend bucket | |
| 19 | + - aws s3api create-bucket --bucket hygo.real-e-state.frontend --create-bucket-configuration LocationConstraint=us-west-1 | |
| 20 | + - aws s3api delete-public-access-block --bucket hygo.real-e-state.frontend | |
| 21 | + - aws s3api put-bucket-policy --bucket hygo.real-e-state.frontend --policy file://Client/bucket-policy.json | |
| 22 | + - aws s3 website hygo.real-e-state.frontend --index index.html --error index.html | |
| 13 | 23 | |
| 14 | 24 | build: |
| 15 | 25 | commands: |
| @@ -21,7 +31,8 @@ phases: | ||
| 21 | 31 | commands: |
| 22 | 32 | # Copy the build output to your S3 bucket |
| 23 | 33 | - echo Copying build files to S3 bucket... |
| 24 | - - aws s3 sync ./Client/build/ s3://hygo.real-estate/ --delete | |
| 34 | + - aws s3 website | |
| 35 | + - aws s3 sync ./Client/build/ s3://hygo.real-e-state/ --delete | |
| 25 | 36 | cache: |
| 26 | 37 | paths: |
| 27 | 38 | - Client/node_modules |
+6-1server/dockerfile
| @@ -1 +1,6 @@ | ||
| 1 | -FROM node: | |
| 1 | +FROM node:20 | |
| 2 | +WORKDIR /code | |
| 3 | +COPY package.json . | |
| 4 | +RUN npm i | |
| 5 | +COPY . . | |
| 6 | +CMD ["npm", "start"] |