Merge pull request #37 from StuffNoOneCaresAbout/pr-alpine
Alpine based docker image.
This commit is contained in:
commit
0fd019966b
@ -1,2 +1,7 @@
|
|||||||
.git
|
.git
|
||||||
|
.gitignore
|
||||||
Dockerfile
|
Dockerfile
|
||||||
|
docker-compose.yml
|
||||||
|
LICENSE
|
||||||
|
*.md
|
||||||
|
yotter-config.json
|
||||||
|
12
Dockerfile
12
Dockerfile
@ -1,15 +1,21 @@
|
|||||||
FROM python:3
|
FROM python:alpine
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
RUN apk add gcc musl-dev libffi-dev openssl-dev libxml2-dev libxslt-dev file llvm-dev make g++
|
||||||
|
|
||||||
COPY requirements.txt ./
|
COPY requirements.txt ./
|
||||||
|
|
||||||
|
RUN pip install wheel cryptography gunicorn pymysql
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN flask db init \
|
RUN flask db init \
|
||||||
&& flask db migrate\
|
&& flask db migrate \
|
||||||
&& flask db upgrade
|
&& flask db upgrade
|
||||||
|
|
||||||
CMD [ "flask", "run", "--host", "0.0.0.0" ]
|
CMD flask db upgrade \
|
||||||
|
&& gunicorn -b 0.0.0.0:5000 -w 4 yotter:app
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
28
docker-compose.yml
Normal file
28
docker-compose.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
version: '3.4'
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:latest
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: changeme
|
||||||
|
MYSQL_DATABASE: yotter
|
||||||
|
MYSQL_USER: yotter
|
||||||
|
MYSQL_PASSWORD: changeme
|
||||||
|
restart: on-failure
|
||||||
|
volumes:
|
||||||
|
- /var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin", "ping", "--silent"]
|
||||||
|
yotter:
|
||||||
|
image: yotter
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5000:5000"
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: mysql+pymysql://yotter:changeme@mariadb:3306/yotter
|
||||||
|
depends_on:
|
||||||
|
- mariadb
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
volumes:
|
||||||
|
- /usr/src/app/migrations
|
||||||
|
- ./yotter-config.json:/usr/src/app/yotter-config.json
|
Reference in New Issue
Block a user