Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run backend container error #56

Open
YFJL-code opened this issue Nov 11, 2024 · 0 comments
Open

run backend container error #56

YFJL-code opened this issue Nov 11, 2024 · 0 comments

Comments

@YFJL-code
Copy link

backend log:
2024-11-11

DockerFIle:

Use the official Node.js 18 image as a base

FROM node:18

Create and set the working directory

WORKDIR /usr/src/app

COPY .npmrc .npmrc

Install global

RUN npm config set -g registry https://registry.npm.taobao.org
RUN npm config set strict-ssl true

RUN apt-get update || : && apt-get install python3 make g++ -y || rm -rf /var/cache/apk/*

RUN npm install -g ts-node typescript grunt grunt-cli
RUN npm install -g grunt-cli bower

Copy package.json and package-lock.json (if available)

COPY package*.json ./

Install app dependencies

RUN npm ci

Copy the rest of the application code

COPY . .

Run the build script to compile TypeScript to JavaScript

RUN npm run build

Expose the port the app runs on

EXPOSE 3000

Start the application

CMD ["npm", "start"]

docker-copose:
worklenz:
build:
context: ./worklenz/build/worklenz-frontend
dockerfile: Dockerfile
container_name: worklenz
ports:
- 4200:4200
depends_on:
backend:
condition: service_started
restart: always
networks:
- worklenz

backend:
build:
context: ./worklenz/build/worklenz-backend
dockerfile: Dockerfile
container_name: worklenz-backend
ports:
- 3000:3000
depends_on:
worklenz-db:
condition: service_healthy
environment:
- DB_HOST=worklenz-db
- DB_NAME=worklenz_db
- DB_PASSWORD=worklenz
- DB_USER=worklenz_backend
#- ANGULAR_DIST_DIR: test
#- ANGULAR_SRC_DIR: test
#- AWS_REGION: test
#- BACKEND_PUBLIC_DIR: test
#- BACKEND_VIEWS_DIR: test
#- COMMIT_BUILD_IMMEDIATELY: test
#- COOKIE_SECRET: test
#- GOOGLE_CALLBACK_URL: test
- GOOGLE_CLIENT_ID=test
- GOOGLE_CLIENT_SECRET=test
#- HOSTNAME="192.168.0.139"
- PORT=3000
- SESSION_NAME=test
- SESSION_SECRET=test
#- SLACK_WEBHOOK: test
#- SOCKET_IO_CORS: test
#- SOURCE_EMAIL="[email protected]"
#- USE_PG_NATIVE: test
#- BUCKET: test
#- REGION: test
- S3_URL=test
- S3_ACCESS_KEY_ID=test
- S3_SECRET_ACCESS_KEY=test
restart: always
networks:
- worklenz

worklenz-db:
image: postgres:15
container_name: worklenz-db
environment:
POSTGRES_DB: worklenz_db
POSTGRES_PASSWORD: worklenz
healthcheck:
test: ["CMD-SHELL", "pg_isready -d worklenz_db -U worklenz_client"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- /xyz/worklenz/db:/var/lib/postgresql/data
- /xyz/worklenz/backend-db/:/docker-entrypoint-initdb.d
restart: always
networks:
- worklenz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant