- Docker
- Docker Compose
Download source code from this repository
$ cd /your/path/src/
$ git clone https://github.com/aidrd/nanbyodata.git
$ cd nanbyodata
Create .env
file and set values for your environment.
$ cp templete.env .env
(default: nanbyodata-app
)
The name of the docker container. Must be unique in the system.
(default: 8888
)
Port to listen on. Must be unique in the system.
(default: https://nanbyodata.jp
)
The URL of the server. Specifically, the base URL of the SPARQList to connect to.
See Local development environment
section.
NOTE: If you are using a version prior to Docker Compose v2.0.0, use the docker-compose
command instead of docker compose
$ docker compose up -d
$ docker compose ps
NAME SERVICE STATUS PORTS
nanbyodata-app app running 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp
Check the application page can be displayed from a browser on the port number specified in the .env
file. e.g. http://localhost:8000
$ docker-compose stop
If the source code is changed, it must be stop
and then start
; this can also be done with the restart
command.
$ docker-compose down
If .env
or docker-compose.yml
is changed, delete the container and start it with up -d
Procedure for preparing a development environment on the local PC instead of on the server.
Almost the same as the server environment but use docker-compose_for_dev.yml
instead of the default docker-compose.yml
. Specify the YML file with the -f
option.
Local development environment also includes the nginx container, so also specify the NGINX_PORT
port in the .env
file.(see below)
(default: 8888
)
Nginx port to listen on. Must be unique in the system.
Only required in the local development environment.
Run only once when building the environment
$ docker network create nanbyodata_dev
If you have not created a network, you may get the following error
$ docker compose -f docker-compose_for_dev.yml up -d
Error response from daemon: network nanbyodata_dev not found
$ docker compose -f docker-compose_for_dev.yml up -d
$ docker-compose -f docker-compose_for_dev.yml ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
nanbyodata-app nanbyodata-app "pipenv run uwsgi --…" app 3 seconds ago Up 2 seconds 0.0.0.0:8000->8000/tcp
nanbyodata-nginx nginx:1.27.1 "/docker-entrypoint.…" nginx 3 seconds ago Up 2 seconds 0.0.0.0:8888->80/tcp
$ docker compose -f docker-compose_for_dev.yml stop
If the source code is changed, it must be stop
and then start
; this can also be done with the restart
command.
$ docker compose -f docker-compose_for_dev.yml down
If .env
or docker-compose.yml
is changed, delete the container and start it with up -d