Created
October 9, 2018 01:28
-
-
Save charliewilco/ad221471cf4cda17c0f4111a9ff8f849 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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