Skip to content

Commit

Permalink
[docker-compose.yml] Use latest image version ; replace Redis with va…
Browse files Browse the repository at this point in the history
…lkey ; [README.md] Document further docker ; [Dockerfile] Update versions and misc. work to ensure it still builds
  • Loading branch information
SamuelMarks committed Jun 7, 2024
1 parent 83d2f8c commit f044fe2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ ADD https://raw.githubusercontent.com/fdemmer/wait-for/2c082fc/wait-for /bin/wai
# Install OS dependencies
RUN apk --no-cache --virtual build-dependencies add \
git \
python \
python3 \
build-base \
openssl \
libcrypto3 \
netcat-openbsd \
&& printf '%s' "${NODE_VERSION}" > /env.node

Expand All @@ -33,8 +33,7 @@ RUN npm i -g npm \
typings \
typescript \
&& typings install \
&& rm -rf node_modules \
&& npm install \
&& npm ci \
&& tsc

FROM alpine:latest as app
Expand All @@ -49,7 +48,7 @@ COPY --from=builder /env.node /env.node

RUN addgroup -S node -g 998 \
&& adduser -S -G node -u 998 node \
&& apk --no-cache add nodejs="`cat /env.node`-r0"
&& apk --no-cache add nodejs # ="`cat /env.node`-r0"

USER node

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ Simple baseline scaffold to get you started using [TypeORM](https://github.com/t
- Redis. Set `REDIS_URL` env var accordingly; otherwise defaults are used.
- Set: `DEFAULT_ADMIN_EMAIL` and `DEFAULT_ADMIN_PASSWORD` env vars

## Docker
## Docker / Podman

Alternatively there is a `Dockerfile` and `docker-compose.yml`, so rather than installing dependencies (other than [Docker](https://docs.docker.com/install/#supported-platforms)), you can run:

### Docker Compose
### 0. Build image for this repo

docker build -t restify-orm-scaffold_api_1 .

### 1. Docker Compose

docker-compose up

Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '2'
services:
redis:
image: redis:alpine
valkey:
image: valkey/valkey:7.2.5
postgres:
image: postgres:13-alpine
image: 16.3-alpine3.20
environment:
POSTGRES_USER: rest_api_user
POSTGRES_PASSWORD: rest_api_pass
Expand All @@ -17,7 +17,7 @@ services:
- /rest-api/node_modules
depends_on:
- postgres
- redis
- valkey
environment:
RDBMS_URI: postgres://rest_api_user:rest_api_pass@postgres/rest_api_db
REDIS_HOST: redis
Expand Down

0 comments on commit f044fe2

Please sign in to comment.