๋ฐ์ํ
Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- ์๋๋ก์ด๋ ์คํ๋์ค
- streamlit
- ํ๋ค์ค
- MySQL
- ์๋๋ก์ด๋ ์ฑ ๊ฐ๋ฐ
- ์๋ฐ์คํฌ๋ฆฝํธ
- RESTful API
- ํ์ด์ฌ
- ์น๋์๋ณด๋ ์ ์
- ์๋ฐ๊ธฐ์ด
- ์๋ฐ์คํฌ๋ฆฝํธ ๊ณต๋ถ
- ๋ฐ์ดํฐ๋ฒ ์ด์ค
- ์คํธ๋ฆผ๋ฆฟ ๊ธฐ๋ณธ
- Matplotlib ๊ธฐ์ด
- ํ์ด์ฌ๊ณต๋ถ
- Streamlit๊ธฐ์ด
- serverless
- Pandas
- ์๋ฐ๊ณต๋ถ
- java
- ์๋ฐํ๋ก๊ทธ๋๋ฐ
- ์คํธ๋ฆผ๋ฆฟ
- ์๋ฐ
- db
- JavaScript
- ์๋ฐ์ด๋ณด
- Android
- ํ๋ค์ค๊ณต๋ถ
- Streamlit๊ธฐ๋ณธ
- ์น๋์๋ณด๋ ๊ธฐ์ด
Archives
- Today
- Total
ruriruriya
[Docker] ๋์ปค ์ค์น ๋ฐฉ๋ฒ ๋ฐ ํ๊ฒฝ์ค์ ํ๊ธฐ ๋ณธ๋ฌธ
๋ฐ์ํ
1. ์ฐ์ ๋์ปค ํํ์ด์ง์์ ๋์ปค๋ฅผ ์ค์น ํ๋ค.
ํ์๊ฐ์ ์ ํ๊ณ
ํ์๊ฐ์ ์ด ๋๋๋ฉด Tell us about the wolrk you do์์๋ skip์ ํด๋ฆญํ๋ค.
๊ทธ๋ฆฌ๊ณ ์ค์น๋ ๋์ปค ๋ฐ์คํฌํฑ์ ์ด์ด ๋ก๊ทธ์ธ ํ๋ฉด ๋๋ค.
2. ๋์ปค ์คํ์ ์ํ ์ค์
2.1. serverless.yml ํ์ผ ์์
provider:
name: aws
runtime: python3.10
region: ap-northeast-2
ecr:
images:
appimage:
path: ./
functions:
app:
image:
name: appimage
timeout: 50
events:
- httpApi: '*'
2.2. requirements.txt ํ์ผ ์์ (์๋ ๋ด์ฉ ์ถ๊ฐ)
serverless-wsgi
flask-restful
mysql-connector-python
psycopg-binary
passlib
flask-jwt-extended
email-validator
2.3. app.py import
import serverless_wsgi
.
.
.
def handler(event, context):
return serverless_wsgi.handle_request(app, event, context)
if **name** == '**main**' :
app.run()
2.4. Dockerfile ์์ฑ
FROM public.ecr.aws/lambda/python:3.10
COPY . ${LAMBDA_TASK_ROOT}
COPY requirements.txt .
RUN yum -y install gcc
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}"
CMD ["app.handler"]
2.5. .dockerignore ํ์ผ ์์ฑ
#.dockerignore
pycache/
.git/
.serverless/
.gitignore
.dockerignore
serverless.yml
๋ฐ์ํ