Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mersocarlin/docker-node
Base docker image for all of my NodeJS apps.
https://github.com/mersocarlin/docker-node
docker docker-image nodejs
Last synced: 2 days ago
JSON representation
Base docker image for all of my NodeJS apps.
- Host: GitHub
- URL: https://github.com/mersocarlin/docker-node
- Owner: mersocarlin
- License: mit
- Created: 2020-10-18T09:44:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-20T20:18:15.000Z (11 months ago)
- Last Synced: 2024-04-24T10:07:09.375Z (8 months ago)
- Topics: docker, docker-image, nodejs
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/mersocarlin/docker-node
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mersocarlin/docker-node
Base docker image for all of my NodeJS apps.
## π How to
In `Dockerfile`:
```
FROM mersocarlin/docker-node# create app directory in container
RUN mkdir -p /app# set /app directory as default working directory
WORKDIR /app# copy package.json, yarn.lock (or package-lock.json) and install dependencies
ADD package.json yarn.lock /app/# --pure-lockfile: Donβt generate a yarn.lock lockfile
RUN yarn --pure-lockfileCOPY . /app/
# expose container port
EXPOSE 3001CMD [ "yarn", "test" ]
```## Publishing a new version to Docker registry
```bash
docker build -t mersocarlin/docker-node:20-alpine
git tag v20-alpine
docker tag mersocarlin/docker-node:20-alpine mersocarlin/docker-node:latest
docker push mersocarlin/docker-node:latest
git push origin --tags
```