Lightsail

Revision as of 05:42, 19 December 2023 by Bpopp (talk | contribs) (Created page with "== Build and Deploy to Lightsail == Create dockerfile <pre> FROM python:3.11-slim as build EXPOSE 5003/tcp WORKDIR /app COPY requirements.txt . RUN pip install -r require...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Build and Deploy to Lightsail

Create dockerfile

FROM python:3.11-slim as build

EXPOSE 5003/tcp

WORKDIR /app

COPY requirements.txt .

RUN pip install -r requirements.txt

copy . .

CMD [ "python", "./app.py" ]

Create .dockerignore

.idea/
.git/
venv/
Website/venv/
__pycache__/

Build

docker build -t test-container .


Test

docker run -it --rm -p 8080:8080 test-container

Push the Container

aws lightsail push-container-image    \
    --region us-east-2               \
    --service-name default \
    --label test-container \
    --image test-container