Skip to content

Instantly share code, notes, and snippets.

@miukki
Created May 2, 2019 05:13
Show Gist options
  • Save miukki/36586c05f4ab927ba1c431b8deae6d4a to your computer and use it in GitHub Desktop.
Save miukki/36586c05f4ab927ba1c431b8deae6d4a to your computer and use it in GitHub Desktop.
Docker container / deploy to EC2 nodejs/reactjs assets
version: "2"
services:
app:
container_name: app
restart: always
build: .
ports:
- "3000:3000"
links:
- mongo
mongo:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
adm-client git:(feature/issues-70) docker-compose build
mongo uses an image, skipping
Building app
Step 1/9 : FROM node:10
10: Pulling from library/node
e79bb959ec00: Downloading [=========================================> ] 37.67MB/45.34MB
d4b7902036fe: Download complete
1b2a72d4e030: Download complete
d54db43011fd: Downloading [===========================> ] 27.95MB/50.07MB
69d473365bb3: Downloading [=====> ] 23.58MB/215MB
6e2490ee2dc8: Waiting
6381e1b5feaa: Waiting
b1efb42c63e2: Waiting
version: "2"
services:
app:
container_name: app
restart: always
build: .
ports:
- "3000:3000"
links:
- mongo
mongo:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
@miukki
Copy link
Author

miukki commented May 2, 2019

Dockerfile config

FROM node:10
WORKDIR /usr/src/app
COPY . .
RUN yarn add pm2 -g
RUN yarn
RUN yarn prebuild
EXPOSE 3000
CMD [ "yarn", "docker" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment