Closed davidcr01 closed 1 year ago
To perform this task, I found some links which may be useful:
:red_circle: After some tries, I could not perform the docker compose up
command due to this error: Cannot find node module 'node:fs'
. I tried to install this module with npm install fs
, but this does not work, even if the module was added to the package.json
file as a dependency.
:heavy_check_mark: The solution was to change the first line of the Dockerfile
of the frontend part. In the tutorials, the specified system was:
FROM node:11.4.0-alpine
in the first tutorialFROM node:13-alpine
in the second tutorial.And the current latest stable version of Node.js (NPM) was 18.14.0. With this, changing the first line of the file to FROM node:18-alpine
solved the problem.
To summarize, it is important to use new versions of the tool to avoid deprecated functions that may cause errors.
If I navigate to https://localhost:8080
the initial Ionic app is displayed:
And if I navigate to https://localhost:80
the Django page keeps displaying:
The log shows that the three containers are running correctly and connected:
[+] Running 3/0
⠿ Container ng Created 0.0s
⠿ Container wordle-db-1 Created 0.0s
⠿ Container dj Created 0.0s
Attaching to dj, ng, wordle-db-1
wordle-db-1 |
wordle-db-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
wordle-db-1 |
wordle-db-1 | 2023-02-11 18:04:00.814 UTC [1] LOG: starting PostgreSQL 15.1 (Debian 15.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
ng | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
ng | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
ng | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
ng | 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
wordle-db-1 | 2023-02-11 18:04:00.830 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
wordle-db-1 | 2023-02-11 18:04:00.830 UTC [1] LOG: listening on IPv6 address "::", port 5432
ng | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version
ng | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
ng | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
ng | /docker-entrypoint.sh: Configuration complete; ready for start up
ng | 2023/02/11 18:04:00 [notice] 1#1: using the "epoll" event method
ng | 2023/02/11 18:04:00 [notice] 1#1: nginx/1.23.3
ng | 2023/02/11 18:04:00 [notice] 1#1: built by gcc 12.2.1 20220924 (Alpine 12.2.1_git20220924-r4)
ng | 2023/02/11 18:04:00 [notice] 1#1: OS: Linux 5.15.91-1-MANJARO
ng | 2023/02/11 18:04:00 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
ng | 2023/02/11 18:04:00 [notice] 1#1: start worker processes
ng | 2023/02/11 18:04:00 [notice] 1#1: start worker process 29
ng | 2023/02/11 18:04:00 [notice] 1#1: start worker process 30
ng | 2023/02/11 18:04:00 [notice] 1#1: start worker process 31
ng | 2023/02/11 18:04:00 [notice] 1#1: start worker process 32
wordle-db-1 | 2023-02-11 18:04:00.866 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
wordle-db-1 | 2023-02-11 18:04:00.886 UTC [29] LOG: database system was shut down at 2023-02-11 17:58:40 UTC
wordle-db-1 | 2023-02-11 18:04:00.900 UTC [1] LOG: database system is ready to accept connections
dj | Watching for file changes with StatReloader
dj | Performing system checks...
dj |
dj | System check identified no issues (0 silenced).
dj | February 11, 2023 - 18:04:01
dj | Django version 4.1.6, using settings 'djangoproject.settings'
dj | Starting development server at http://0.0.0.0:80/
dj | Quit the server with CONTROL-C.
This issue aims to build a dockerized project.
It is necessary to dockerize the backend of the application. This concerns the Ionic Framework. The new container has to communicate with the controller of the project, the Django RESTful API.