mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-22 19:41:53 +03:00
Merge pull request #2 from twentyhq/cbo-configure-deploy-on-aws
Configure AWS codebuild to automate deploy
This commit is contained in:
commit
64d07b907c
14
Dockerfile
Normal file
14
Dockerfile
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
FROM node:18-alpine as app
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
WORKDIR /app/front
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
WORKDIR /app/server
|
||||||
|
RUN npm install
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
CMD ["npm", "run", "start:prod"]
|
24
buildspec.yml
Normal file
24
buildspec.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
version: 0.2
|
||||||
|
|
||||||
|
phases:
|
||||||
|
pre_build:
|
||||||
|
commands:
|
||||||
|
- echo Logging in to Amazon ECR...
|
||||||
|
- aws ecr get-login-password --region eu-west-3 | docker login --username AWS --password-stdin 255840220362.dkr.ecr.eu-west-3.amazonaws.com
|
||||||
|
build:
|
||||||
|
commands:
|
||||||
|
- echo Build started on `date`
|
||||||
|
- docker build -t twenty-pilot .
|
||||||
|
- docker tag twenty-pilot 255840220362.dkr.ecr.eu-west-3.amazonaws.com/twenty-pilot:latest
|
||||||
|
- cd $CODEBUILD_SRC_DIR
|
||||||
|
post_build:
|
||||||
|
commands:
|
||||||
|
- echo Build completed on `date`
|
||||||
|
- echo Pushing the Docker images...
|
||||||
|
- docker push 255840220362.dkr.ecr.eu-west-3.amazonaws.com/twenty-pilot:latest
|
||||||
|
- echo Writing image definitions file...
|
||||||
|
- printf '{"AWSEBDockerrunVersion":"1","Image":{"Name":"%s","Update":"true"},"Ports":[{"ContainerPort":3000,"HostPort":80}]}' 255840220362.dkr.ecr.eu-west-3.amazonaws.com/twenty-pilot:latest > Dockerrun.aws.json
|
||||||
|
- cat Dockerrun.aws.json
|
||||||
|
|
||||||
|
artifacts:
|
||||||
|
files: Dockerrun.aws.json
|
Loading…
Reference in New Issue
Block a user