Skip to content

Commit

Permalink
local docker set up
Browse files Browse the repository at this point in the history
  • Loading branch information
gugzkumar committed Nov 28, 2019
1 parent 8a7adfd commit 2ebe1af
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.7-alpine
RUN apk update && \
apk upgrade && \
apk add bash && \
apk add --no-cache --virtual build-deps build-base gcc && \
pip install aws-sam-cli==0.34.0 && \
apk del build-deps
RUN mkdir /app
WORKDIR /app
CMD ["tail", "-f", "/dev/null"]
2 changes: 2 additions & 0 deletions api/standup-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Starts the API with SAM LOCAL
sam local start-api --host 0.0.0.0 -p 3000 -v $SAM_LOCAL_ABSOLUTE_PATH
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ services:
- /usr/src/app/node_modules
ports:
- "4200:4200"
# --------------------------------------------------------------------------
# BACKEND WRITTEN IN AWS SAM LOCAL
# --------------------------------------------------------------------------
serverless-lambda-api:
build: ./api
container_name: serverless-lambda-api
env_file:
.env
volumes:
- ./api:/app
- /var/run/docker.sock:/var/run/docker.sock
- ./api:${SAM_LOCAL_ABSOLUTE_PATH}
ports:
- "3000:3000"
command: sh standup-api.sh

0 comments on commit 2ebe1af

Please sign in to comment.