split dev container and dev vscode container

This commit is contained in:
gaugau3000 2020-06-04 14:23:46 +00:00
parent fb7925e7a1
commit 11b7521cc7
6 changed files with 8770 additions and 20 deletions

View File

@ -1,4 +1,4 @@
FROM node:12-stretch FROM node:12-stretch as dev
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
@ -28,6 +28,15 @@ WORKDIR $HOME
EXPOSE 8080 EXPOSE 8080
# install dependencies
RUN yarn install
WORKDIR $HOME/frequi
FROM dev as vscode
WORKDIR $HOME
# load ssh key in bash terminal # load ssh key in bash terminal
RUN echo "eval \$(ssh-agent) && ssh-add ~/.ssh/id_rsa" >> .bashrc RUN echo "eval \$(ssh-agent) && ssh-add ~/.ssh/id_rsa" >> .bashrc

View File

@ -1,7 +1,7 @@
/* cSpell:disable */ /* cSpell:disable */
{ {
"name": "frequi", "name": "frequi",
"dockerComposeFile": "docker-compose.yml", "dockerComposeFile": ["docker-compose.yml","docker-compose.vscode.yml"],
"service": "web", "service": "web",
"workspaceFolder": "/home/dev/frequi", "workspaceFolder": "/home/dev/frequi",
"settings": { "settings": {

View File

@ -0,0 +1,18 @@
version: '3.4'
services:
web:
build:
context: .
target: vscode
image: freqtradeorg/frequi:vscode
volumes:
- "/home/${USER}/.ssh:/home/dev/.ssh:ro"
- "/home/${USER}/.gitconfig:/home/dev/.gitconfig:ro"
- frequi-bashhistory:/home/dev/commandhistory
- frequi-vscode-server:/home/dev/.vscode-server
- frequi-server-insiders:/home/dev/.vscode-server-insiders
volumes:
frequi-bashhistory:
frequi-vscode-server:
frequi-server-insiders:

View File

@ -3,23 +3,16 @@ services:
web: web:
build: build:
context: . context: .
dockerfile: Dockerfile target: dev
image: freqtradeorg/frequi:dev
user: dev user: dev
volumes: volumes:
- ../:/home/dev/frequi - ../:/home/dev/frequi
- "/home/${USER}/.ssh:/home/dev/.ssh:ro"
- "/home/${USER}/.gitconfig:/home/dev/.gitconfig:ro"
- frequi-bashhistory:/home/dev/commandhistory
- frequi-vscode-server:/home/dev/.vscode-server
- frequi-server-insiders:/home/dev/.vscode-server-insiders
command: /bin/sh -c "while sleep 1000; do :; done" command: /bin/sh -c "while sleep 1000; do :; done"
networks: networks:
- frequi - frequi
ports:
- 8080:8080
networks: networks:
frequi: frequi:
volumes:
frequi-bashhistory:
frequi-vscode-server:
frequi-server-insiders:

View File

@ -37,6 +37,27 @@ npm run lint
### Customize configuration ### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/). See [Configuration Reference](https://cli.vuejs.org/config/).
## Project setup for docker (developing inside dev container) without vscode
### Built dev docker image and run container(s) detached
```
cd .devcontainer
docker-compose up -d
```
### Go inside web service container and serve
```
docker-compose exec web /bin/bash
```
then
```
yarn serve
```
## Project setup for vscode and docker (developing inside dev container) on linux ## Project setup for vscode and docker (developing inside dev container) on linux
The goal is it have a complete dev environment very quickly and isolated. The goal is it have a complete dev environment very quickly and isolated.
@ -49,11 +70,7 @@ Follow [getting strated](https://code.visualstudio.com/docs/remote/containers#_g
View > Command palette > Enter: Remote-Containers rebuild container View > Command palette > Enter: Remote-Containers rebuild container
### Install dependencies and serve your local server ### Serve your local server
```
yarn install
```
``` ```
yarn serve yarn serve

8713
yarn.lock Normal file

File diff suppressed because it is too large Load Diff