Skip to content

Instantly share code, notes, and snippets.

@charliewilco
Created October 9, 2018 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save charliewilco/ad221471cf4cda17c0f4111a9ff8f849 to your computer and use it in GitHub Desktop.
Save charliewilco/ad221471cf4cda17c0f4111a9ff8f849 to your computer and use it in GitHub Desktop.
version: '3'
services:
app:
container_name: downwrite-api
restart: always
build: .
environment:
- PORT=4888
- MONGO_URL=mongo:27017
ports:
- '4888:4888'
links:
- mongo
mongo:
container_name: downwrite-db
image: mongo:latest
ports:
- '27017:27017'
FROM mhart/alpine-node:10
WORKDIR /usr/src/app
COPY package.json ./
# # add files to container
# ADD . /app
# # specify the working directory
# WORKDIR /app
# RUN chmod -R 777 .
COPY . .
# build process
RUN apk --no-cache --virtual build-dependencies add \
python \
make \
g++
RUN npm install node-pre-gyp -g
RUN npm install
RUN npm run build
RUN npm prune --production
EXPOSE 4000
# run application
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment