Skip to content

Commit 979f7fd

Browse files
Dockerize (#44)
* update node version * add docker commands
1 parent b2c9714 commit 979f7fd

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

Makefile

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
IMGNAME?=ghcr.io/libertech-fr/teaket:latest
1+
IMGNAME?=ghcr.io/libertech-fr/teaket
22
APPNAME?=teaket
3+
APP_PORT?=3000
4+
SERVICE_PORT?=7000
35
MINIO_ACCESS_KEY?=AKIAIOSFODNN7EXAMPLE
46
MINIO_SECRET_KEY?=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
57

@@ -12,9 +14,52 @@ help:
1214
run-app:
1315
cd ./app && yarn dev
1416

17+
run-app-docker:
18+
docker run --rm -it \
19+
-e NODE_ENV=development \
20+
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
21+
--add-host host.docker.internal:host-gateway \
22+
--name $(APPNAME)-app \
23+
--network dev \
24+
-p $(APP_PORT):3000 \
25+
-p 24678:24678 \
26+
-v $(CURDIR):/usr/src/app \
27+
$(IMGNAME)/app yarn workspace @libertech-fr/teaket_app dev
28+
29+
install-app-docker:
30+
docker run -it --rm \
31+
-v $(CURDIR):/usr/src/app \
32+
$(IMGNAME)/app yarn workspace @libertech-fr/teaket_app install
33+
34+
exec-app:
35+
docker run -it --rm \
36+
-v $(CURDIR):/usr/src/app \
37+
$(IMGNAME)/app sh
38+
1539
run-service:
1640
cd ./service && yarn start:dev
1741

42+
run-service-docker:
43+
docker run --rm -it \
44+
-e NODE_ENV=development \
45+
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
46+
--add-host host.docker.internal:host-gateway \
47+
--name $(APPNAME)-service \
48+
--network dev \
49+
-p $(SERVICE_PORT):4000 \
50+
-v $(CURDIR):/usr/src/app \
51+
$(IMGNAME)/service yarn workspace @libertech-fr/teaket_service start:dev
52+
53+
install-service-docker:
54+
docker run -it --rm \
55+
-v $(CURDIR):/usr/src/app \
56+
$(IMGNAME)/service yarn workspace @libertech-fr/teaket_service install
57+
58+
exec-service:
59+
docker run -it --rm \
60+
-v $(CURDIR):/usr/src/app \
61+
$(IMGNAME)/service sh
62+
1863
run: ## Run app and service
1964
@make dbs &
2065
@make run-app &

app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.14.0-alpine
1+
FROM node:18.18.2-alpine
22

33
ARG NODE_ENV=production
44
ENV NODE_ENV=${NODE_ENV}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"radash": "^11.0.0"
3030
},
3131
"devDependencies": {
32-
"@types/node": "^18.16.0",
32+
"@types/node": "^18.18.2",
3333
"@typescript-eslint/eslint-plugin": "^6.5.0",
3434
"@typescript-eslint/parser": "^6.5.0",
3535
"eslint": "^8.48.0",

service/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.14.0-alpine AS builder
1+
FROM node:18.18.2-alpine AS builder
22

33
WORKDIR /usr/src/app
44

@@ -12,7 +12,7 @@ RUN apk add git && yarn workspace @libertech-fr/teaket_service install \
1212

1313
RUN yarn workspace @libertech-fr/teaket_service run build
1414

15-
FROM node:18.14.0-alpine AS production
15+
FROM node:18.18.2-alpine AS production
1616

1717
ARG NODE_ENV=production
1818
ENV NODE_ENV=${NODE_ENV}

0 commit comments

Comments
 (0)