fix dockerfile and docker compose
This commit is contained in:
parent
3dc043e6c4
commit
1051ed71e2
@ -25,7 +25,6 @@ COPY --from=deps leCoffre/package.json package.json
|
|||||||
COPY tsconfig.json tsconfig.json
|
COPY tsconfig.json tsconfig.json
|
||||||
COPY src src
|
COPY src src
|
||||||
|
|
||||||
COPY src/common/databases/schema.prisma ./src/common/databases/schema.prisma
|
|
||||||
RUN npx prisma generate
|
RUN npx prisma generate
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
@ -39,6 +38,7 @@ RUN adduser -D lecoffreuser --uid 10000 && chown -R lecoffreuser .
|
|||||||
COPY --from=builder --chown=lecoffreuser leCoffre/node_modules ./node_modules
|
COPY --from=builder --chown=lecoffreuser leCoffre/node_modules ./node_modules
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre/dist dist
|
COPY --from=builder --chown=lecoffreuser leCoffre/dist dist
|
||||||
COPY --from=builder --chown=lecoffreuser leCoffre/package.json ./package.json
|
COPY --from=builder --chown=lecoffreuser leCoffre/package.json ./package.json
|
||||||
|
COPY --from=builder --chown=lecoffreuser leCoffre/src/common/databases ./src/common/databases
|
||||||
|
|
||||||
USER lecoffreuser
|
USER lecoffreuser
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
### A. Docker Launch application
|
### A. Docker Launch application
|
||||||
#### 1) Local RSA Key for docker build
|
#### 1) Local RSA Key for docker build
|
||||||
|
|
||||||
1) Create a file named : `id_rsa` in /src
|
1) Create a file named : `id_rsa` in /src/.ssh
|
||||||
2) Get the RSA Private key on Keeper who is allowed to read the `leCoffre-ressources repo`
|
2) Get the RSA Private key on Keeper who is allowed to read the `leCoffre-ressources repo`
|
||||||
3) You can find Key on Keeper inside the folder **LeCoffre project > SSH Key**
|
3) You can find Key on Keeper inside the folder **LeCoffre project > SSH Key**
|
||||||
4) Copy past in the `id_rsa` that you created step 1
|
4) Copy past in the `id_rsa` that you created step 1
|
||||||
@ -16,7 +16,7 @@
|
|||||||
#### 2) Build images
|
#### 2) Build images
|
||||||
|
|
||||||
###### a- Back end
|
###### a- Back end
|
||||||
`docker build -t "le-coffre-back" -f Dockerfiles/Dockerfile.api .`
|
`docker build -t "le-coffre-back" -f Dockerfile .`
|
||||||
###### b- Front end
|
###### b- Front end
|
||||||
`docker build -t "le-coffre-front" -f Dockerfiles/Dockerfile.front .`
|
`docker build -t "le-coffre-front" -f Dockerfiles/Dockerfile.front .`
|
||||||
|
|
||||||
|
@ -7,13 +7,13 @@ services:
|
|||||||
front-end:
|
front-end:
|
||||||
image: "le-coffre-front"
|
image: "le-coffre-front"
|
||||||
ports:
|
ports:
|
||||||
- 3000:${FRONT_PORT}
|
- ${FRONT_PORT}:${FRONT_PORT}
|
||||||
environment:
|
environment:
|
||||||
- FRONT_PORT
|
- FRONT_PORT
|
||||||
backend:
|
backend:
|
||||||
image: "le-coffre-back"
|
image: "le-coffre-back"
|
||||||
ports:
|
ports:
|
||||||
- 3001:${APP_PORT}
|
- ${APP_PORT}:${APP_PORT}
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_HOSTNAME
|
- DATABASE_HOSTNAME
|
||||||
- DATABASE_PORT
|
- DATABASE_PORT
|
||||||
@ -37,7 +37,7 @@ services:
|
|||||||
- DATABASE_NAME
|
- DATABASE_NAME
|
||||||
- POSTGRES_PASSWORD
|
- POSTGRES_PASSWORD
|
||||||
ports:
|
ports:
|
||||||
- ${DATABASE_PORT}:5432
|
- ${DATABASE_PORT}:${DATABASE_PORT}
|
||||||
volumes:
|
volumes:
|
||||||
- db_storage:/var/lib/postgresql/data
|
- db_storage:/var/lib/postgresql/data
|
||||||
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user