From b2ba6354c200b24df3d7992a6152ad6b8daf3699 Mon Sep 17 00:00:00 2001 From: Harm Weites Date: Tue, 26 May 2020 22:06:52 +0200 Subject: [PATCH] Use Alpine as root image --- app/Dockerfile | 20 ++++++++------------ frontend/Dockerfile | 15 ++++++--------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/app/Dockerfile b/app/Dockerfile index 68711629..9709fae6 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,20 +1,16 @@ -FROM python:3.6 +FROM alpine:3.9.6 + +CMD ["python3"] -# set work directory WORKDIR /app -# set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 -# install psycopg2 dependencies -RUN apt-get update \ - && apt-get install --no-install-recommends -y python3-dev libpq-dev unixodbc-dev +COPY . /app/ -# install dependencies -RUN pip install --upgrade pip setuptools -COPY ./requirements.txt /app/requirements.txt -RUN pip install --no-cache-dir -r requirements.txt +RUN apk add -U python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \ + && pip3 install --upgrade pip setuptools \ + && pip3 install --no-cache-dir -r requirements.txt \ + && apk del python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev -# copy project -COPY . /app/ diff --git a/frontend/Dockerfile b/frontend/Dockerfile index bf124695..66e68674 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,14 +1,11 @@ -FROM node:13.2.0 +FROM node:13.2-alpine -# set work directory WORKDIR /app -# copy project COPY . /app/ -# install dependencies -RUN npm install -g npm@latest -RUN npm install - -# build project -RUN npm run build +RUN apk add -U git python3 make g++ \ + && npm install -g npm@latest \ + && npm install \ + && npm run build \ + && apk del git make g++