Skip to content

Instantly share code, notes, and snippets.

@VassilisPallas
Created November 10, 2019 20:39
Show Gist options
  • Save VassilisPallas/35b7e5cff1794d17bdeaf523ef2c34cf to your computer and use it in GitHub Desktop.
Save VassilisPallas/35b7e5cff1794d17bdeaf523ef2c34cf to your computer and use it in GitHub Desktop.
Dockerfile for serverless with pyhton 3.7 and pipenv

In serverless.yml file the below line should be added in custom section

serverless-offline: host: 0.0.0.0

FROM python:3.7
LABEL author="Vassilis Pallas"
# set environment for pipenv
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# install nodejs
RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_13.x | bash \
&& apt-get install nodejs -yq
COPY package*.json ./
COPY Pipfile* ./
RUN npm i
RUN pip3 install pipenv
RUN pipenv install --dev
COPY . .
EXPOSE 3000
CMD ["pipenv", "run", "npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment