Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
diaspora
Commits
dae1717d
Unverified
Commit
dae1717d
authored
Oct 28, 2018
by
CSammy
Committed by
Dennis Schubert
Oct 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docker setup for development
closes #7870
parent
0133a9f3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
713 additions
and
0 deletions
+713
-0
Changelog.md
Changelog.md
+2
-0
docker/develop/Dockerfile
docker/develop/Dockerfile
+62
-0
docker/develop/docker-compose.yml
docker/develop/docker-compose.yml
+41
-0
docker/develop/docker-entrypoint.sh
docker/develop/docker-entrypoint.sh
+47
-0
docker/develop/docker-exec-entrypoint.sh
docker/develop/docker-exec-entrypoint.sh
+7
-0
script/diaspora-dev
script/diaspora-dev
+554
-0
No files found.
Changelog.md
View file @
dae1717d
...
...
@@ -2,6 +2,8 @@
## Refactor
*
Make setting up a development environment 9001% easier by adding a Docker-based setup
[
#7870
](
https://github.com/diaspora/diaspora/pull/7870
)
## Bug fixes
## Features
...
...
docker/develop/Dockerfile
0 → 100644
View file @
dae1717d
FROM
ruby:2.4.4-slim-stretch
RUN
DEBIAN_FRONTEND
=
noninteractive
\
apt-get update
&&
\
apt-get
install
-y
-qq
\
build-essential
\
cmake
\
curl
\
ghostscript
\
git
\
imagemagick
\
libcurl4-openssl-dev
\
libidn11-dev
\
libmagickwand-dev
\
libmariadbclient-dev
\
libpq-dev
\
libssl-dev
\
libxml2-dev
\
libxslt-dev
\
nodejs
\
gosu
\
&&
\
rm
-rf
/var/lib/apt/lists/
*
ARG
DIA_UID
ARG
DIA_GID
ENV
HOME="/home/diaspora" \
GEM_HOME="/diaspora/vendor/bundle"
RUN
addgroup
--gid
$DIA_GID
diaspora
&&
\
adduser
\
--no-create-home
\
--disabled-password
\
--gecos
""
\
--uid
$DIA_UID
\
--gid
$DIA_GID
\
diaspora
\
&&
\
mkdir
$HOME
/diaspora
&&
\
chown
-R
diaspora:diaspora
$HOME
/diaspora
RUN
curl
-L
\
https://cifiles.diasporafoundation.org/phantomjs-2.1.1-linux-x86_64.tar.bz2
\
|
tar
-xj
-C
/usr/local/bin
\
--transform
=
's#.*/##'
\
phantomjs-2.1.1-linux-x86_64/bin/phantomjs
ENV
BUNDLE_PATH="$GEM_HOME" \
BUNDLE_BIN="$GEM_HOME/bin" \
BUNDLE_APP_CONFIG="/diaspora/.bundle"
ENV
PATH $BUNDLE_BIN:$PATH
COPY
docker-entrypoint.sh /entrypoint.sh
COPY
docker-exec-entrypoint.sh /exec-entrypoint.sh
ENTRYPOINT
["/entrypoint.sh"]
CMD
["./script/server"]
docker/develop/docker-compose.yml
0 → 100644
View file @
dae1717d
version
:
"
3.4"
volumes
:
postgresql_data
:
mysql_data
:
dia_data_tmp
:
dia_data_bundle
:
services
:
diaspora
:
build
:
context
:
.
dockerfile
:
Dockerfile
args
:
DIA_UID
:
"
${DIASPORA_ROOT_UID}"
DIA_GID
:
"
${DIASPORA_ROOT_GID}"
image
:
diaspora:dev-latest
volumes
:
-
"
${DIASPORA_ROOT}:/diaspora:rw"
-
dia_data_tmp:/diaspora/tmp
-
dia_data_bundle:/diaspora/vendor/bundle
ports
:
-
8080:3000
depends_on
:
-
"
${DIASPORA_DOCKER_DB}"
postgresql
:
image
:
postgres:10.3
ports
:
-
55432:5432
volumes
:
-
postgresql_data:/var/lib/postgresql
mysql
:
image
:
mariadb:10.2
ports
:
-
53306:3306
volumes
:
-
mysql_data:/var/lib/mysql
environment
:
MYSQL_ROOT_PASSWORD
:
mysql
docker/develop/docker-entrypoint.sh
0 → 100755
View file @
dae1717d
#!/bin/bash
# ----- Ensure correct ownership of /diaspora -----
dia_home
=
/home/diaspora
HOST_UID
=
$(
stat
-c
%u /diaspora
)
HOST_GID
=
$(
stat
-c
%g /diaspora
)
if
!
getent group
$HOST_GID
>
/dev/null
;
then
groupmod
--gid
$HOST_GID
diaspora
fi
if
!
getent passwd
$HOST_UID
>
/dev/null
;
then
usermod
--uid
$HOST_UID
--gid
$HOST_GID
diaspora
fi
chown
-R
$HOST_UID
:
$HOST_GID
/home/diaspora
mkdir
-p
/diaspora/tmp/pids
chown
$HOST_UID
:
$HOST_GID
/diaspora/tmp /diaspora/tmp/pids /diaspora/vendor/bundle
# ----- Wait for DB ----
if
[
-z
$DIA_NODB
]
||
[
!
$DIA_NODB
-eq
1
]
;
then
if
grep
-qFx
" <<: *postgresql"
/diaspora/config/database.yml
;
then
host
=
postgresql
port
=
5432
else
host
=
mysql
port
=
3306
fi
c
=
0
trap
'{ exit 1; }'
INT
while
!
(
< /dev/tcp/
${
host
}
/
${
port
}
)
2>/dev/null
;
do
printf
"
\r
Waiting for
$host
:
$port
to become ready ...
${
c
}
s"
sleep
1
((
c++
))
done
trap
- INT
if
[
!
-z
$c
]
;
then
printf
"
\r
Waiting for
$host
:
$port
to become ready ... done (
${
c
}
s)
\n
"
fi
fi
cd
/diaspora
gosu
$HOST_UID
:
$HOST_GID
"
$@
"
docker/develop/docker-exec-entrypoint.sh
0 → 100755
View file @
dae1717d
#!/bin/bash
HOST_UID
=
$(
stat
-c
%u /diaspora
)
HOST_GID
=
$(
stat
-c
%g /diaspora
)
cd
/diaspora
gosu
$HOST_UID
:
$HOST_GID
"
$@
"
script/diaspora-dev
0 → 100755
View file @
dae1717d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment