Skip to content

Create Dockerfile #334

Open
Open
@JGAntunes

Description

@JGAntunes

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.

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"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions