Skip to content
This repository has been archived by the owner on Jul 7, 2018. It is now read-only.

Create Dockerfile #19

Open
JGAntunes opened this issue Nov 22, 2016 · 0 comments
Open

Create Dockerfile #19

JGAntunes opened this issue Nov 22, 2016 · 0 comments

Comments

@JGAntunes
Copy link
Member

This is just an example pulled from other projects which might have different requirements from this one (it's a node app still, but doesn't need mongo and other stuff). But it might be cool to use this as a basis for something else.

The idea is to containerise the app and have it running on a single container. From there we'll see what we'll use.

Also, do this one the new app, probably no need to do it on the older one.

FROM alpine

WORKDIR /code

ENV APK_PACKAGES bash
ENV NODE_ENV production
ENV PORT 3000

RUN apk \
    --update-cache --repository http://dl-2.alpinelinux.org/alpine/edge/main \
    --update add \
    "nodejs<7.0.0" \
    ${APK_PACKAGES} \
    && rm -rf /var/cache/apk/*

RUN npm install -g yarn && rm -rf ~/.npm

EXPOSE 3000

COPY package.json yarn.lock ./
RUN yarn && rm -rf ~/.yarn-cache
COPY . .
CMD [ "node", "src/index.js" ]

LABEL \
    version="" \
    os="linux" \
    arch="amd64"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants