Browse Source

Use Alpine as root image

pull/795/head
Harm Weites 4 years ago
parent
commit
b2ba6354c2
2 changed files with 14 additions and 21 deletions
  1. 20
      app/Dockerfile
  2. 15
      frontend/Dockerfile

20
app/Dockerfile

@ -1,20 +1,16 @@
FROM python:3.6
FROM alpine:3.9.6
CMD ["python3"]
# set work directory
WORKDIR /app WORKDIR /app
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 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/

15
frontend/Dockerfile

@ -1,14 +1,11 @@
FROM node:13.2.0
FROM node:13.2-alpine
# set work directory
WORKDIR /app WORKDIR /app
# copy project
COPY . /app/ 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++
Loading…
Cancel
Save