Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LDV Specification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
LDV Specification
Commits
106f1ed7
Commit
106f1ed7
authored
2 years ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
add instructions to use local Docker container for Postgres
parent
29860d81
No related branches found
No related tags found
1 merge request
!2
postgres to docker in development environment
Pipeline
#33674
passed
2 years ago
Stage: test
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+57
-0
57 additions, 0 deletions
README.md
ldvspec/docker/docker-compose-postgres-dev.yml
+22
-0
22 additions, 0 deletions
ldvspec/docker/docker-compose-postgres-dev.yml
ldvspec/lofardata/templates/lofardata/index.html
+1
-1
1 addition, 1 deletion
ldvspec/lofardata/templates/lofardata/index.html
with
80 additions
and
1 deletion
README.md
+
57
−
0
View file @
106f1ed7
...
...
@@ -25,6 +25,63 @@ After a collegue has made changes, then locally
*
pip install -r requirements
\d
ev.txt
*
python manage.py migrate --settings=ldvspec.settings.dev
## Local Development Environment
### Postgres Database in Docker
Run
`docker-compose up -d`
with the following compose file to spin up a new Postgres container.
See the
`docker-compose-postgres-dev.yml`
file in the
`docker`
directory.
(not that port 5433 is used. You can change that at will, but then also change it in
`dev.py`
)
```
yaml
version
:
"
3.7"
services
:
ldv-spec-db
:
image
:
postgres:14
container_name
:
ldv-spec-postgres
expose
:
-
5433
ports
:
-
5433:5432
environment
:
POSTGRES_PASSWORD
:
"
secret"
POSTGRES_USER
:
"
postgres"
POSTGRES_DB
:
"
ldv-spec-db"
volumes
:
-
ldv-spec-db:/var/lib/postgresql/data
restart
:
always
volumes
:
ldv-spec-db
:
```
### Django Application
*
clone the repo
*
open the project in Pycharm
*
create a venv (File -> Settings -> Project -> Project Interpreter -> (click cog) -> add)
*
pip install -r requirements
\d
ev.txt
*
check and/or change the database connection in settings/dev/py. In this example it connects to a database server on 'raspiastro',
you have to change that to the server where you run your Postgres Docker container (localhost?)
```
python
DATABASES
=
{
'
default
'
:
{
'
ENGINE
'
:
'
django.db.backends.postgresql_psycopg2
'
,
'
USER
'
:
'
postgres
'
,
'
PASSWORD
'
:
'
secret
'
,
'
NAME
'
:
'
ldv-spec-db
'
,
'
HOST
'
:
'
raspiastro
'
,
'
PORT
'
:
'
5433
'
,
},
}
```
*
python manage.py migrate --settings=ldvspec.settings.dev
*
python manage.py runserver --settings=ldvspec.settings.dev
## Test Environment
*
https://sdc-dev.astron.nl/ldvspec/
...
...
This diff is collapsed.
Click to expand it.
ldvspec/docker/docker-compose-postgres-dev.yml
0 → 100644
+
22
−
0
View file @
106f1ed7
version
:
"
3.7"
services
:
ldv-spec-db
:
image
:
postgres:14
container_name
:
ldv-spec-postgres
expose
:
-
5433
ports
:
-
5433:5432
env_file
:
-
$HOME/shared/ldvspec.env
environment
:
POSTGRES_PASSWORD
:
"
secret"
POSTGRES_USER
:
"
postgres"
POSTGRES_DB
:
"
ldv-spec-db"
volumes
:
-
ldv-spec-db:/var/lib/postgresql/data
restart
:
always
volumes
:
ldv-spec-db
:
\ No newline at end of file
This diff is collapsed.
Click to expand it.
ldvspec/lofardata/templates/lofardata/index.html
+
1
−
1
View file @
106f1ed7
...
...
@@ -16,7 +16,7 @@
</tbody>
</table>
<p
class=
"footer"
>
Version 1.0.0 (2
5
jul 2022 -
8
:00)
<p
class=
"footer"
>
Version 1.0.0 (2
6
jul 2022 -
13
:00)
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment